ithewei vor 7 Jahren
Ursprung
Commit
6a9fce7fa6
2 geänderte Dateien mit 10 neuen und 6 gelöschten Zeilen
  1. 5 1
      hplatform.h
  2. 5 5
      hthread.h

+ 5 - 1
hplatform.h

@@ -8,10 +8,14 @@
     #include <winsock2.h>
     #include <windows.h>
     #undef  WIN32_LEAN_AND_MEAN
+
+    #define strcasecmp stricmp
+    #define strncasecmp strnicmp
 #else
+    #include <sys/types.h>
+    #include <sys/time.h>  // for gettimeofday
     #include <unistd.h>
     #include <pthread.h>
-    #include <sys/time.h>
 
     #include <strings.h>
     #define stricmp     strcasecmp

+ 5 - 5
hthread.h

@@ -12,15 +12,15 @@
 inline uint32 getpid() {
     return GetCurrentProcessId();
 }
-#endif
 
 inline uint32 gettid() {
-#ifdef _MSC_VER
     return GetCurrentThreadId();
-#else
-    return pthread_self();
-#endif
 }
+#endif
+
+#if defined(__unix__) && !defined(__ANDROID__)
+#define gettid  pthread_self
+#endif
 
 /************************************************
  * HThread