Merge pull request #10506 from fowles/sync-stage

move portable_strdup into the windows ifdef
pull/10508/head
Matt Fowles Kulukundis 3 years ago committed by GitHub
commit 9890369bc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      src/google/protobuf/compiler/subprocess.cc

@ -54,16 +54,6 @@ namespace google {
namespace protobuf {
namespace compiler {
namespace {
char* portable_strdup(const char* s) {
char* ns = (char*)malloc(strlen(s) + 1);
if (ns != nullptr) {
strcpy(ns, s);
}
return ns;
}
} // namespace
#ifdef _WIN32
static void CloseHandleOrDie(HANDLE handle) {
@ -318,6 +308,16 @@ Subprocess::~Subprocess() {
}
}
namespace {
char* portable_strdup(const char* s) {
char* ns = (char*)malloc(strlen(s) + 1);
if (ns != nullptr) {
strcpy(ns, s);
}
return ns;
}
} // namespace
void Subprocess::Start(const std::string& program, SearchMode search_mode) {
// Note that we assume that there are no other threads, thus we don't have to
// do crazy stuff like using socket pairs or avoiding libc locks.

Loading…
Cancel
Save