path: root/msvc_extra_headers
diff options
authorJohn Emmas <>2016-05-28 19:07:22 +0100
committerJohn Emmas <>2016-05-28 19:07:22 +0100
commit22e031135ac2b81d8ac5d8d17d5a5a5b40281b6d (patch)
tree0ba1a82e4e1d008fb53b52287c51461c656d611d /msvc_extra_headers
parentebeffdd2949b8d915c2bb8cc447a675d7a0de5da (diff)
Emulate 'log1p()' and 'expm1()' using 'log()' and 'exp()'
(for MSVC which didn't implement those functions until very recent versions).
Diffstat (limited to 'msvc_extra_headers')
1 files changed, 9 insertions, 3 deletions
diff --git a/msvc_extra_headers/ardourext/misc.h.input b/msvc_extra_headers/ardourext/misc.h.input
index 161ed167f1..11ba638494 100644
--- a/msvc_extra_headers/ardourext/misc.h.input
+++ b/msvc_extra_headers/ardourext/misc.h.input
@@ -254,9 +254,15 @@ inline int64_t abs(int64_t val) throw()
#if !defined(LIBPBD_API) || defined(PBD_IS_IN_WIN_STATIC_LIB)
extern double round(double x);
-// log2().... MSVC doesn't offer the C99 function 'log2()'
-// so let's emulate it.
-extern double log2(double x);
+// Emulate some C99 math functions which MSVC itself didn't
+// implement until later in life.
+#if defined(_MSC_VER) && (_MSC_VER < 1800)
+extern double expm1(double x);
+extern double log1p(double x);
+#if defined(_MSC_VER) && (_MSC_VER < 1900)
+extern double log2 (double x);
#endif /* __ardour_msvc_extensions_h__ */