diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2021-10-06 07:42:01 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2021-10-06 08:18:19 +0200 |
commit | b04b3064ec3f28ac1bd87b97cf66e125a6d3843a (patch) | |
tree | 0864186d5c7d983200bab7913225a8d57dc34317 /thirdparty/bullet | |
parent | a7ba22763139b29d825e0f4ef3e718533da069ea (diff) |
bullet: Fix UWP build by disabling TaskScheduler dynamic loading
Cf. https://github.com/bulletphysics/bullet3/pull/3991
(cherry picked from commit cbe0cff53dadc29735977899c69a5231cb00eff9)
Diffstat (limited to 'thirdparty/bullet')
-rw-r--r-- | thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportWin32.cpp | 6 | ||||
-rw-r--r-- | thirdparty/bullet/patches/fix-win32-scheduler-uwp.patch | 24 |
2 files changed, 30 insertions, 0 deletions
diff --git a/thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportWin32.cpp b/thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportWin32.cpp index 922e449cce..5862264a67 100644 --- a/thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportWin32.cpp +++ b/thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportWin32.cpp @@ -82,6 +82,11 @@ typedef BOOL(WINAPI* Pfn_GetLogicalProcessorInformation)(PSYSTEM_LOGICAL_PROCESS void getProcessorInformation(btProcessorInfo* procInfo) { memset(procInfo, 0, sizeof(*procInfo)); +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \ + !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + // Can't dlopen libraries on UWP. + return; +#else Pfn_GetLogicalProcessorInformation getLogicalProcInfo = (Pfn_GetLogicalProcessorInformation)GetProcAddress(GetModuleHandle(TEXT("kernel32")), "GetLogicalProcessorInformation"); if (getLogicalProcInfo == NULL) @@ -160,6 +165,7 @@ void getProcessorInformation(btProcessorInfo* procInfo) } } free(buf); +#endif } ///btThreadSupportWin32 helps to initialize/shutdown libspe2, start/stop SPU tasks and communication diff --git a/thirdparty/bullet/patches/fix-win32-scheduler-uwp.patch b/thirdparty/bullet/patches/fix-win32-scheduler-uwp.patch new file mode 100644 index 0000000000..c65db49388 --- /dev/null +++ b/thirdparty/bullet/patches/fix-win32-scheduler-uwp.patch @@ -0,0 +1,24 @@ +diff --git a/thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportWin32.cpp b/thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportWin32.cpp +index 922e449cce..5862264a67 100644 +--- a/thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportWin32.cpp ++++ b/thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportWin32.cpp +@@ -82,6 +82,11 @@ typedef BOOL(WINAPI* Pfn_GetLogicalProcessorInformation)(PSYSTEM_LOGICAL_PROCESS + void getProcessorInformation(btProcessorInfo* procInfo) + { + memset(procInfo, 0, sizeof(*procInfo)); ++#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \ ++ !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) ++ // Can't dlopen libraries on UWP. ++ return; ++#else + Pfn_GetLogicalProcessorInformation getLogicalProcInfo = + (Pfn_GetLogicalProcessorInformation)GetProcAddress(GetModuleHandle(TEXT("kernel32")), "GetLogicalProcessorInformation"); + if (getLogicalProcInfo == NULL) +@@ -160,6 +165,7 @@ void getProcessorInformation(btProcessorInfo* procInfo) + } + } + free(buf); ++#endif + } + + ///btThreadSupportWin32 helps to initialize/shutdown libspe2, start/stop SPU tasks and communication |