Modify 'ardourext/misc.h' so that it only uses C++ constructs when the compilation...
authorJohn Emmas <johne53@tiscali.co.uk>
Tue, 27 Aug 2013 16:10:46 +0000 (17:10 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Tue, 27 Aug 2013 16:10:46 +0000 (17:10 +0100)
msvc_extra_headers/ardourext/misc.h.input

index dfe9e053369c4d72e052e9e065beaf4ad2e5f4fc..63ce6c562c8cef006eb22c9ce92143c4698dfcae 100644 (file)
 #define _CPP_VECTOR  1
 #endif
 
+#ifdef __cplusplus
 #include <vector>
+#endif
+
 #include <math.h>
 #include <float.h>
 #include <direct.h>
@@ -171,7 +174,11 @@ typedef int register_t;
 
 // throw()
 #ifndef __THROW
+#ifdef __cplusplus
 #define __THROW  throw()
+#else
+#define __THROW
+#endif
 #endif
 
 // round().... Unlike Linux, Windows doesn't seem to support the
@@ -198,6 +205,7 @@ typedef _mode_t mode_t;
 #endif /* _MODE_T_ */
 
 // int64 abs()
+#ifdef __cplusplus // Normal 'C' doesn't permit over-ridden functions !!
 inline uint64_t abs(int64_t val)
 {
        if (val < 0)
@@ -205,6 +213,7 @@ inline uint64_t abs(int64_t val)
        else
                return val;
 }
+#endif
 
 // fmin() and fmax()
 #define fmin(a, b) min((double)a, (double)b)
@@ -221,6 +230,7 @@ inline uint64_t abs(int64_t val)
 
 
 // #include the main headers for Ardour MSVC
+#ifdef __cplusplus
 #if defined(BUILDING_PBD) || defined(PBD_IS_IN_WIN_STATIC_LIB)
 #include <pbd/msvc_pbd.h>
 #endif
@@ -230,5 +240,6 @@ inline uint64_t abs(int64_t val)
 #if defined(BUILDING_RUBBERBAND) || defined(RUBBERBAND_IS_IN_WIN_STATIC_LIB)
 #include <rubberband/msvc_rubberband.h>
 #endif
+#endif // __cplusplus
 
 #endif /* __ardour_msvc_extensions_h__ */