From 8e51a6c84f255f936b797dcb490c4157e02c6c85 Mon Sep 17 00:00:00 2001 From: John Emmas Date: Mon, 13 Jan 2014 10:22:31 +0000 Subject: Check in some minor modifications (to MSVC specific headers) --- msvc_extra_headers/ardourext/misc.h.input | 43 ++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'msvc_extra_headers/ardourext/misc.h.input') diff --git a/msvc_extra_headers/ardourext/misc.h.input b/msvc_extra_headers/ardourext/misc.h.input index e9e2c94b65..79fb5aafab 100644 --- a/msvc_extra_headers/ardourext/misc.h.input +++ b/msvc_extra_headers/ardourext/misc.h.input @@ -74,11 +74,6 @@ #ifndef PATH_MAX #define PATH_MAX _MAX_PATH #endif -#define DECLARE_DEFAULT_COMPARISONS(Type) \ - extern bool operator > (const Type& lhs, const Type& rhs); \ - extern bool operator < (const Type& lhs, const Type& rhs); \ - extern bool operator != (const Type& lhs, const Type& rhs); \ - extern bool operator == (const Type& lhs, const Type& rhs); // Types missing from Win32 'stat.h' (hopefully Windows // will either act sensibly or ignore most of them). @@ -182,15 +177,6 @@ typedef int register_t; #endif #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(PBD_API) || defined(PBD_IS_IN_WIN_STATIC_LIB) -extern double round(double x); -#endif - // System V compatibility typedef unsigned short ushort; typedef unsigned int uint; @@ -232,8 +218,17 @@ 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) +#if defined(LIBPBD_DLL) || defined(PBD_IS_IN_WIN_STATIC_LIB) #include + +#ifdef LIBPBD_DLL +#define DEFAULT_COMPARISONS_DEFINED +#define DECLARE_DEFAULT_COMPARISONS(Type) \ + LIBPBD_API bool operator > (const Type& lhs, const Type& rhs); \ + LIBPBD_API bool operator < (const Type& lhs, const Type& rhs); \ + LIBPBD_API bool operator != (const Type& lhs, const Type& rhs); \ + LIBPBD_API bool operator == (const Type& lhs, const Type& rhs); +#endif #endif #if defined(BUILDING_LIBARDOUR) || defined(LIBARDOUR_IS_IN_WIN_STATIC_LIB) #include @@ -243,4 +238,22 @@ inline uint64_t abs(int64_t val) #endif #endif // __cplusplus +#ifndef DEFAULT_COMPARISONS_DEFINED +#define DEFAULT_COMPARISONS_DEFINED +#define DECLARE_DEFAULT_COMPARISONS(Type) \ + extern bool operator > (const Type& lhs, const Type& rhs); \ + extern bool operator < (const Type& lhs, const Type& rhs); \ + extern bool operator != (const Type& lhs, const Type& rhs); \ + 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) +extern double round(double x); +#endif + #endif /* __ardour_msvc_extensions_h__ */ -- cgit v1.2.3