From 763ed73a7e5dd90f224b0410cc2874412eaaed71 Mon Sep 17 00:00:00 2001 From: "noelallen@google.com" Date: Mon, 21 Jan 2013 03:38:56 +0000 Subject: NaCl SDK example failson Windows On Windows we use a struct for the pthread_t. The example sets the struct to NULL which causes an error. In addition, the example uses "this" in the constructor which generates a warning which becomes an error. NOTRY=true TBR=binji@chromium.org BUG= Review URL: https://codereview.chromium.org/12039004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177887 0039d316-1c4b-4281-b951-d872f2087c98 --- native_client_sdk/src/examples/input_events/input_events.cc | 12 +++++++++--- native_client_sdk/src/libraries/gtest/Makefile | 2 +- native_client_sdk/src/tools/host_vc.mk | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'native_client_sdk') diff --git a/native_client_sdk/src/examples/input_events/input_events.cc b/native_client_sdk/src/examples/input_events/input_events.cc index 5ff49ba..1a0a9f8 100644 --- a/native_client_sdk/src/examples/input_events/input_events.cc +++ b/native_client_sdk/src/examples/input_events/input_events.cc @@ -22,6 +22,10 @@ #include "custom_events.h" #include "shared_queue.h" +#ifdef PostMessage +#undef PostMessage +#endif + namespace event_queue { const char* const kDidChangeView = "DidChangeView"; const char* const kHandleInputEvent = "DidHandleInputEvent"; @@ -89,7 +93,8 @@ class EventInstance : public pp::Instance { // Create the 'worker thread'. bool Init(uint32_t argc, const char* argn[], const char* argv[]) { - pthread_create(&event_thread_, NULL, ProcessEventOnWorkerThread, this); + event_thread_ = new pthread_t; + pthread_create(event_thread_, NULL, ProcessEventOnWorkerThread, this); return true; } @@ -319,11 +324,12 @@ class EventInstance : public pp::Instance { void CancelQueueAndWaitForWorker() { if (event_thread_) { event_queue_.CancelQueue(); - pthread_join(event_thread_, NULL); + pthread_join(*event_thread_, NULL); + delete event_thread_; event_thread_ = NULL; } } - pthread_t event_thread_; + pthread_t* event_thread_; LockingQueue event_queue_; pp::CompletionCallbackFactory callback_factory_; }; diff --git a/native_client_sdk/src/libraries/gtest/Makefile b/native_client_sdk/src/libraries/gtest/Makefile index cd3d7c9..035fcd4 100644 --- a/native_client_sdk/src/libraries/gtest/Makefile +++ b/native_client_sdk/src/libraries/gtest/Makefile @@ -14,7 +14,7 @@ # to override this, specify TOOLCHAIN=newlib|glibc or CONFIG=Debug|Release on # the make command-line or in this file prior to including common.mk. The # toolchain we use by default will be the first valid one listed -VALID_TOOLCHAINS:=newlib glibc +VALID_TOOLCHAINS:=newlib glibc linux win # diff --git a/native_client_sdk/src/tools/host_vc.mk b/native_client_sdk/src/tools/host_vc.mk index 87d6621..df426db 100644 --- a/native_client_sdk/src/tools/host_vc.mk +++ b/native_client_sdk/src/tools/host_vc.mk @@ -15,8 +15,8 @@ # We use the C++ compiler for everything and then use the -Wl,-as-needed flag # in the linker to drop libc++ unless it's actually needed. # -HOST_CC?=cl.exe /nologo /WX -HOST_CXX?=cl.exe /nologo /EHsc /WX +HOST_CC?=cl.exe /nologo +HOST_CXX?=cl.exe /nologo /EHsc HOST_LINK?=link.exe /nologo HOST_LIB?=lib.exe /nologo -- cgit v1.1