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

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: Remove rules to include self where possible 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
« no previous file with comments | « ppapi/tests/DEPS ('k') | ppapi/tests/test_audio_config.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/pp_thread.h
diff --git a/ppapi/tests/pp_thread.h b/ppapi/tests/pp_thread.h
index f168d8ca980efae65026dd8391f759a3164588b9..c4af8f1bbf1094d95c06d2b4519577c23fc60d9c 100644
--- a/ppapi/tests/pp_thread.h
+++ b/ppapi/tests/pp_thread.h
@@ -7,20 +7,15 @@
#define PPAPI_TESTS_PP_THREAD_H_
#include "ppapi/c/pp_macros.h"
+#include "ppapi/tests/test_utils.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 +33,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 +46,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 +83,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,
« no previous file with comments | « ppapi/tests/DEPS ('k') | ppapi/tests/test_audio_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698