summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-07-25 18:24:23 +0000
committerMartin Storsjo <martin@martin.st>2018-07-25 18:24:23 +0000
commitb52e084ca81da9f2d03ab21a8625aeada7e64a67 (patch)
tree32a7a8578c4511adab0bbe880570ce4f051100f3 /src
parentd9cfbf1a891cbc09edf0f618d945efe215eca01e (diff)
downloadlibcxx-b52e084ca81da9f2d03ab21a8625aeada7e64a67.tar.gz
[windows] Fix warning about comparing ints of different signs
This fixes a warning like this: warning: comparison of integers of different signs: 'std::__1::__libcpp_tls_key' (aka 'long') and 'DWORD' (aka 'unsigned long') [-Wsign-compare] if (*__key == FLS_OUT_OF_INDEXES) ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~ Differential Revision: https://reviews.llvm.org/D49782 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src')
-rw-r--r--src/support/win32/thread_win32.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/support/win32/thread_win32.cpp b/src/support/win32/thread_win32.cpp
index 471049429..1567042d8 100644
--- a/src/support/win32/thread_win32.cpp
+++ b/src/support/win32/thread_win32.cpp
@@ -254,9 +254,10 @@ void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns)
int __libcpp_tls_create(__libcpp_tls_key* __key,
void(_LIBCPP_TLS_DESTRUCTOR_CC* __at_exit)(void*))
{
- *__key = FlsAlloc(__at_exit);
- if (*__key == FLS_OUT_OF_INDEXES)
+ DWORD index = FlsAlloc(__at_exit);
+ if (index == FLS_OUT_OF_INDEXES)
return GetLastError();
+ *__key = index;
return 0;
}