NoteCreateDrag - remove some code
[ardour.git] / msvc_extra_headers / ardourext / misc.h.input
index 79fb5aafab2e4c7894219dc5335e8cf9d5b80d91..a5f4e9e95cecbcfc9fd1d84fb75bab0b3363126f 100644 (file)
 #define INFINITY    HUGE_VAL
 #endif
 
+#ifndef NAN
+#define NAN        _NANCODE
+#endif
+
 // File access modes copied from unistd.h
 #define F_OK 0
 #define R_OK 4
@@ -192,8 +196,9 @@ typedef _mode_t mode_t;
 #endif /* _MODE_T_ */
 
 // int64 abs()
+#if (defined(_MSC_VER) && (_MSC_VER < 1500))
 #ifdef __cplusplus // Normal 'C' doesn't permit over-ridden functions !!
-inline uint64_t abs(int64_t val)
+inline int64_t abs(int64_t val) throw()
 {
        if (val < 0)
                return val * (-1);
@@ -201,6 +206,7 @@ inline uint64_t abs(int64_t val)
                return val;
 }
 #endif
+#endif
 
 // fmin() and fmax()
 #define fmin(a, b) min((double)a, (double)b)
@@ -247,13 +253,19 @@ inline uint64_t abs(int64_t val)
        extern bool operator == (const Type& lhs, const Type& rhs);
 #endif
 
-// round().... Unlike Linux, Windows doesn't seem to support the
-// concept of a system-wide (or programmable) rounding direction.
-// Fortunately, 'round to nearest' seems to be the default action
-// under Linux, so let's copy that until we find out otherwise.
-#define rint(value)  round(value)
 #if !defined(LIBPBD_API) || defined(PBD_IS_IN_WIN_STATIC_LIB)
+// 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);
 extern  double round(double x);
+extern  float roundf(float x);
+#endif
+#if defined(_MSC_VER) && (_MSC_VER < 1900)
+extern  double log2 (double x);
+extern  double trunc(double x);
+#endif
 #endif
 
 #endif /* __ardour_msvc_extensions_h__ */