Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: ppapi/tests/pp_thread.h

Issue 8764004: Add DEPS include rules so we don't accidentally use base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add forgotten DEPS files, fix use of WIN macro Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/tests/pp_thread.h
diff --git a/ppapi/tests/pp_thread.h b/ppapi/tests/pp_thread.h
index f168d8ca980efae65026dd8391f759a3164588b9..20c3da0d340d181b9284bf6203ec2d72479c37d5 100644
--- a/ppapi/tests/pp_thread.h
+++ b/ppapi/tests/pp_thread.h
@@ -8,19 +8,13 @@
#include "ppapi/c/pp_macros.h"
-/* These precompiler names were copied from chromium's build_config.h. */
-#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
- defined(__OpenBSD__) || defined(__sun) || defined(__native_client__)
-#define PPAPI_HAS_POSIX_THREADS 1
-#elif defined (_MSC_VER)
-#define PPAPI_HAS_WINDOWS_THREADS 1
-#endif
-
-#if defined(PPAPI_HAS_POSIX_THREADS)
+#if defined(PPAPI_POSIX)
#include <pthread.h>
-#elif defined(PPAPI_HAS_WINDOWS_THREADS)
+#elif defined(PPAPI_OS_WIN)
#include <process.h>
#include <windows.h>
+#else
+#error No thread library detected.
#endif
/**
@@ -38,9 +32,9 @@
* used in ppapi/tests, so is not part of the published API.
*/
-#if defined(PPAPI_HAS_POSIX_THREADS)
+#if defined(PPAPI_POSIX)
typedef pthread_t PP_ThreadType;
-#elif defined(PPAPI_HAS_WINDOWS_THREADS)
+#elif defined(PPAPI_OS_WIN)
typedef uintptr_t PP_ThreadType;
#endif
@@ -51,7 +45,7 @@ PP_INLINE bool PP_CreateThread(PP_ThreadType* thread,
void* thread_arg);
PP_INLINE void PP_JoinThread(PP_ThreadType thread);
-#if defined(PPAPI_HAS_POSIX_THREADS)
+#if defined(PPAPI_POSIX)
/* Because POSIX thread functions return void* and Windows thread functions do
* not, we make PPAPI thread functions have the least capability (no returns).
* This struct wraps the user data & function so that we can use the correct
@@ -88,7 +82,7 @@ PP_INLINE void PP_JoinThread(PP_ThreadType thread) {
pthread_join(thread, &exit_status);
}
-#elif defined(PPAPI_HAS_WINDOWS_THREADS)
+#elif defined(PPAPI_OS_WIN)
typedef DWORD (PP_WindowsThreadFunction)(void* data);
PP_INLINE bool PP_CreateThread(PP_ThreadType* thread,

Powered by Google App Engine
This is Rietveld 408576698