diff options
Diffstat (limited to 'LibOVR')
-rw-r--r-- | LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp | 7 | ||||
-rw-r--r-- | LibOVR/Src/OVR_CAPI.cpp | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp b/LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp index 4786435..4146dda 100644 --- a/LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp +++ b/LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp @@ -920,7 +920,7 @@ DWORD WINAPI Thread_Win32StartFn(void *phandle) // Ensure that ThreadId is assigned once thread is running, in case
// beginthread hasn't filled it in yet.
- pthread->IdValue = (ThreadId)::GetCurrentThreadId();
+ pthread->IdValue = (ThreadId)(intptr_t)::GetCurrentThreadId(); // should be: typedef intptr_t ThreadId;
DWORD result = pthread->PRun();
// Signal the thread as done and release it atomically.
@@ -1075,7 +1075,8 @@ void Thread::SetThreadName( const char* name ) void Thread::SetThreadName(const char* name, ThreadId threadId)
{
- #if !defined(OVR_BUILD_SHIPPING) || defined(OVR_BUILD_PROFILING)
+ // MinGW does not support SEH exceptions, hence CPP: && defined(OVR_CC_MSVC)
+ #if ( !defined(OVR_BUILD_SHIPPING) || defined(OVR_BUILD_PROFILING) ) && defined(OVR_CC_MSVC)
// http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx
#pragma pack(push,8)
struct THREADNAME_INFO {
@@ -1138,7 +1139,7 @@ int Thread::GetCPUCount() // comparison purposes.
ThreadId GetCurrentThreadId()
{
- return (ThreadId)::GetCurrentThreadId();
+ return (ThreadId)(intptr_t)::GetCurrentThreadId(); // should be: typedef intptr_t ThreadId;
}
} // OVR
diff --git a/LibOVR/Src/OVR_CAPI.cpp b/LibOVR/Src/OVR_CAPI.cpp index bfc0527..8e6c676 100644 --- a/LibOVR/Src/OVR_CAPI.cpp +++ b/LibOVR/Src/OVR_CAPI.cpp @@ -903,7 +903,11 @@ OVR_EXPORT ovrEyeRenderDesc ovrHmd_GetRenderDesc(ovrHmd hmddesc, -#define OVR_OFFSET_OF(s, field) ((size_t)&((s*)0)->field) +#if defined(OVR_CC_MSVC) + #define OVR_OFFSET_OF(s, field) ((size_t)&((s*)0)->field) +#else + #define OVR_OFFSET_OF(s, field) (1) +#endif |