소스 검색

Merge pull request #4887 from lioncash/common-build

microprofile: Silence warning in headers
bunnei 5 년 전
부모
커밋
46fdc94586
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      externals/microprofile/microprofile.h

+ 5 - 1
externals/microprofile/microprofile.h

@@ -948,7 +948,11 @@ typedef HANDLE MicroProfileThread;
 DWORD _stdcall ThreadTrampoline(void* pFunc)
 DWORD _stdcall ThreadTrampoline(void* pFunc)
 {
 {
     MicroProfileThreadFunc F = (MicroProfileThreadFunc)pFunc;
     MicroProfileThreadFunc F = (MicroProfileThreadFunc)pFunc;
-    return (DWORD)F(0);
+
+    // The return value of F will always return a void*, however, this is for
+    // compatibility with pthreads. The underlying "address" of the pointer
+    // is always a 32-bit value, so this cast is safe to perform.
+    return static_cast<DWORD>(reinterpret_cast<uint64_t>(F(0)));
 }
 }
 
 
 inline void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func)
 inline void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func)