]> git.vomp.tv Git - vompclient.git/commitdiff
Update for windows compatibility
authorChris Tallon <chris@vomp.tv>
Sun, 25 Mar 2007 15:57:50 +0000 (15:57 +0000)
committerChris Tallon <chris@vomp.tv>
Sun, 25 Mar 2007 15:57:50 +0000 (15:57 +0000)
log.cc
log.h

diff --git a/log.cc b/log.cc
index 31ebddfc4a2bdb8c4fe800efc5f05d9a0b367ba7..5fd37bcc36ec54a93127e425aa784edb522151a0 100644 (file)
--- a/log.cc
+++ b/log.cc
@@ -124,7 +124,11 @@ int Log::log(char *fromModule, int level, char* message, ...)
   if (level == INFO)    strcpy(levelString, "[info]  ");
   if (level == DEBUG)   strcpy(levelString, "[debug] ");
 
+#ifndef WIN32
   spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%s %d %s - ", levelString, getpid(), fromModule);
+#else
+  spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%s %s - ", levelString,  fromModule);
+#endif
 
   va_list ap;
   va_start(ap, message);
diff --git a/log.h b/log.h
index 66a210dba87f0609398aebf32853594c695b1964..e94f153a6d7a723b03e39817e9f5e925d21d95e2 100644 (file)
--- a/log.h
+++ b/log.h
@@ -24,6 +24,7 @@
 
 #include <stdio.h>
 #ifndef WIN32
+ #include <unistd.h>
  #include <sys/time.h>
 #else
  #include <sys/timeb.h>
@@ -33,7 +34,6 @@
 #include <string.h>
 #include <stdarg.h>
 #include <sys/types.h>
-#include <unistd.h>
 #include "defines.h"
 
 class Log