diff Orthanc/Core/Toolbox.cpp @ 65:78aa0a355d3a

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Aug 2015 14:13:04 +0200
parents 902dedf9882a
children f869ea124433
line wrap: on
line diff
--- a/Orthanc/Core/Toolbox.cpp	Sun Aug 02 15:30:06 2015 +0200
+++ b/Orthanc/Core/Toolbox.cpp	Tue Aug 04 14:13:04 2015 +0200
@@ -34,6 +34,7 @@
 #include "Toolbox.h"
 
 #include "OrthancException.h"
+#include "Logging.h"
 
 #include <string>
 #include <stdint.h>
@@ -53,13 +54,9 @@
 #include <boost/regex.hpp> 
 #endif
 
-#if HAVE_GOOGLE_LOG == 1
-#include <glog/logging.h>
-#endif
-
 #if defined(_WIN32)
 #include <windows.h>
-#include <process.h>   // For "_spawnvp()"
+#include <process.h>   // For "_spawnvp()" and "_getpid()"
 #else
 #include <unistd.h>    // For "execvp()"
 #include <sys/wait.h>  // For "waitpid()"
@@ -1135,7 +1132,7 @@
     if (pid == -1)
     {
       // Error in fork()
-#if HAVE_GOOGLE_LOG == 1
+#if ORTHANC_ENABLE_LOGGING == 1
       LOG(ERROR) << "Cannot fork a child process";
 #endif
 
@@ -1158,7 +1155,7 @@
 
     if (status != 0)
     {
-#if HAVE_GOOGLE_LOG == 1
+#if ORTHANC_ENABLE_LOGGING == 1
       LOG(ERROR) << "System command failed with status code " << status;
 #endif
 
@@ -1274,5 +1271,14 @@
     }
   }
 
+
+  int Toolbox::GetProcessId()
+  {
+#if defined(_WIN32)
+    return static_cast<int>(_getpid());
+#else
+    return static_cast<int>(getpid());
+#endif
+  }
 }