diff options
Diffstat (limited to 'vcpkg/ports/sleef/seh-cpu-ext.diff')
| -rw-r--r-- | vcpkg/ports/sleef/seh-cpu-ext.diff | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/vcpkg/ports/sleef/seh-cpu-ext.diff b/vcpkg/ports/sleef/seh-cpu-ext.diff new file mode 100644 index 0000000..6cd8eaa --- /dev/null +++ b/vcpkg/ports/sleef/seh-cpu-ext.diff @@ -0,0 +1,26 @@ +diff --git a/src/libm/dispatcher.h b/src/libm/dispatcher.h +index 41b69d9..4d395c3 100644 +--- a/src/libm/dispatcher.h ++++ b/src/libm/dispatcher.h +@@ -27,6 +27,14 @@ NOEXPORT int Sleef_internal_cpuSupportsExt(void (*tryExt)(), int *cache) { + static int cache = -1; + if (cache != -1) return cache; + ++#ifdef _MSC_VER ++ __try { ++ (*tryExt)(); ++ cache = 1; ++ } __except(1) { ++ cache = 0; ++ } ++#else + void (*org); + org = signal(SIGILL, sighandler); + +@@ -38,5 +46,6 @@ NOEXPORT int Sleef_internal_cpuSupportsExt(void (*tryExt)(), int *cache) { + } + + signal(SIGILL, org); ++#endif + return cache; + } |