summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-09 19:14:48 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-10 03:18:58 +0100
commit6388d767f4510a3771909a91ad72ad4963d029db (patch)
tree3cda0b925d1115873179d32be3a4ca72139cc54a /compat
parent7d101a1c2827b5e7a373fb0d0a68099fb692e55a (diff)
cmake: cleanup, decruft, probably fix mingw
Diffstat (limited to 'compat')
-rw-r--r--compat/CMakeLists.txt2
-rw-r--r--compat/nan.cpp18
2 files changed, 10 insertions, 10 deletions
diff --git a/compat/CMakeLists.txt b/compat/CMakeLists.txt
index 7e5dd4cd..d55c38c6 100644
--- a/compat/CMakeLists.txt
+++ b/compat/CMakeLists.txt
@@ -5,7 +5,7 @@ if(NOT WIN32 AND NOT APPLE)
endif()
if(WIN32)
- target_link_libraries(opentrack-compat winmm)
+ target_link_libraries(opentrack-compat winmm strmiids)
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
diff --git a/compat/nan.cpp b/compat/nan.cpp
index 338fb789..037efbe1 100644
--- a/compat/nan.cpp
+++ b/compat/nan.cpp
@@ -1,14 +1,16 @@
#include "export.hpp"
+#include "compat/macros.hpp"
+
#if defined(_MSC_VER)
-# include <cmath>
-# define my_isnan std::isnan
-# define my_isinf std::isinf
-OTR_COMPAT_EXPORT __declspec(noinline) bool nanp(double x)
+# include <float.h>
+# include <math.h>
+# define my_isnan ::_isnan
+# define my_isinf ::isinf
#elif defined __MINGW32__
-int __cdecl my_isnan(double)__asm__("__isnan");
-int __cdecl my_fpclassify(double)__asm__("___fpclassify");
+static int __cdecl my_isnan(double)__asm__("__isnan");
+static int __cdecl my_fpclassify(double)__asm__("___fpclassify");
#define FP_NAN 0x0100
#define FP_NORMAL 0x0400
@@ -18,18 +20,16 @@ int __cdecl my_fpclassify(double)__asm__("___fpclassify");
#define my_isinf(x) (my_fpclassify(x) == FP_INFINITE)
-OTR_COMPAT_EXPORT bool __attribute__ ((noinline)) nanp(double x)
#elif defined __APPLE__
# include <math.h>
# define my_isnan(x) isnan(x)
# define my_isinf(x) isinf(x)
-OTR_COMPAT_EXPORT bool __attribute__ ((noinline)) nanp(double x)
#else
int my_isnan(double)__asm__("isnan");
int my_isinf(double)__asm__("isinf");
-OTR_COMPAT_EXPORT bool __attribute__ ((noinline)) nanp(double x)
#endif
+OTR_COMPAT_EXPORT never_inline bool nanp(double x)
{
return my_isnan(x) || my_isinf(x);
}