EricWF created this revision. EricWF added a reviewer: compnerd. EricWF added a subscriber: cfe-commits.
https://reviews.llvm.org/D28735 Files: include/__threading_support Index: include/__threading_support =================================================================== --- include/__threading_support +++ include/__threading_support @@ -495,7 +495,7 @@ void *__arg; }; -static inline _LIBCPP_ALWAYS_INLINE DWORD WINAPI +static inline _LIBCPP_ALWAYS_INLINE unsigned WINAPI __libcpp_beginthreadex_thunk(void *__raw_data) { auto *__data = @@ -503,7 +503,7 @@ auto *__func = __data->__func; void *__arg = __data->__arg; delete __data; - return static_cast<DWORD>(reinterpret_cast<uintptr_t>(__func(__arg))); + return static_cast<unsigned>(reinterpret_cast<uintptr_t>(__func(__arg))); } int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *), @@ -513,13 +513,10 @@ __data->__func = __func; __data->__arg = __arg; - *__t = CreateThread( - nullptr, // default security attributes - 0, // default stack size - __libcpp_beginthreadex_thunk, __data, - 0, // default creation flags - nullptr // output for thread ID - ); + *__t = reinterpret_cast<HANDLE>(_beginthreadex(nullptr, 0, + __libcpp_beginthreadex_thunk, + __data, 0, nullptr)); + if (*__t) return 0; return GetLastError();
Index: include/__threading_support =================================================================== --- include/__threading_support +++ include/__threading_support @@ -495,7 +495,7 @@ void *__arg; }; -static inline _LIBCPP_ALWAYS_INLINE DWORD WINAPI +static inline _LIBCPP_ALWAYS_INLINE unsigned WINAPI __libcpp_beginthreadex_thunk(void *__raw_data) { auto *__data = @@ -503,7 +503,7 @@ auto *__func = __data->__func; void *__arg = __data->__arg; delete __data; - return static_cast<DWORD>(reinterpret_cast<uintptr_t>(__func(__arg))); + return static_cast<unsigned>(reinterpret_cast<uintptr_t>(__func(__arg))); } int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *), @@ -513,13 +513,10 @@ __data->__func = __func; __data->__arg = __arg; - *__t = CreateThread( - nullptr, // default security attributes - 0, // default stack size - __libcpp_beginthreadex_thunk, __data, - 0, // default creation flags - nullptr // output for thread ID - ); + *__t = reinterpret_cast<HANDLE>(_beginthreadex(nullptr, 0, + __libcpp_beginthreadex_thunk, + __data, 0, nullptr)); + if (*__t) return 0; return GetLastError();
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits