diff options
author | John Emmas <johne53@tiscali.co.uk> | 2013-08-27 17:10:46 +0100 |
---|---|---|
committer | John Emmas <johne53@tiscali.co.uk> | 2013-08-27 17:10:46 +0100 |
commit | 9b6687ff3f980f501bcb3a9e170cf2785c59361e (patch) | |
tree | 0bbffef76dd6fd71ebeedbff06fb147a2811cc90 /msvc_extra_headers/ardourext | |
parent | 909fcf4b2df24e4c0794c9af2c00ae9476040548 (diff) |
Modify 'ardourext/misc.h' so that it only uses C++ constructs when the compilation is cplusplus
Diffstat (limited to 'msvc_extra_headers/ardourext')
-rw-r--r-- | msvc_extra_headers/ardourext/misc.h.input | 11 |
1 files changed, 11 insertions, 0 deletions
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 <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__ */ |