From 9b6687ff3f980f501bcb3a9e170cf2785c59361e Mon Sep 17 00:00:00 2001 From: John Emmas Date: Tue, 27 Aug 2013 17:10:46 +0100 Subject: [PATCH] Modify 'ardourext/misc.h' so that it only uses C++ constructs when the compilation is cplusplus --- msvc_extra_headers/ardourext/misc.h.input | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/msvc_extra_headers/ardourext/misc.h.input b/msvc_extra_headers/ardourext/misc.h.input index dfe9e05336..63ce6c562c 100644 --- a/msvc_extra_headers/ardourext/misc.h.input +++ b/msvc_extra_headers/ardourext/misc.h.input @@ -27,7 +27,10 @@ #define _CPP_VECTOR 1 #endif +#ifdef __cplusplus #include +#endif + #include #include #include @@ -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 #endif @@ -230,5 +240,6 @@ inline uint64_t abs(int64_t val) #if defined(BUILDING_RUBBERBAND) || defined(RUBBERBAND_IS_IN_WIN_STATIC_LIB) #include #endif +#endif // __cplusplus #endif /* __ardour_msvc_extensions_h__ */