瀏覽代碼

Move pthread include.

Based on pull request feedback. See commit 60c5222 for why the pthread
header is necessary.
Tom Hughes 10 年之前
父節點
當前提交
c6095505dc
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 4 0
      src/google/protobuf/stubs/mutex.h
  2. 0 2
      src/google/protobuf/stubs/platform_macros.h

+ 4 - 0
src/google/protobuf/stubs/mutex.h

@@ -30,6 +30,10 @@
 #ifndef GOOGLE_PROTOBUF_STUBS_MUTEX_H_
 #define GOOGLE_PROTOBUF_STUBS_MUTEX_H_
 
+#ifdef GOOGLE_PROTOBUF_NO_THREADLOCAL
+#include <pthread.h>
+#endif
+
 #include <google/protobuf/stubs/macros.h>
 
 // ===================================================================

+ 0 - 2
src/google/protobuf/stubs/platform_macros.h

@@ -115,8 +115,6 @@ GOOGLE_PROTOBUF_PLATFORM_ERROR
 // TLS support on android.
 // iOS also does not support the __thread keyword.
 #define GOOGLE_PROTOBUF_NO_THREADLOCAL
-
-#include <pthread.h>
 #endif
 
 #endif  // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_