Check in some minor modifications (to MSVC specific headers)

This commit is contained in:
John Emmas 2014-01-13 10:22:31 +00:00
parent 61c692baa1
commit 8e51a6c84f
3 changed files with 63 additions and 27 deletions

View File

@ -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 <pbd/msvc_pbd.h>
#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 <ardour/msvc_libardour.h>
@ -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__ */

View File

@ -12,7 +12,7 @@
#endif
#ifndef VST_SUPPORT
#define VST_SUPPORT
// Commented out temporarily by JE - 18-10-2013 #define VST_SUPPORT
/* Comment out the above line to build Mixbus without VST support */
#endif
@ -60,6 +60,15 @@ __declspec(selectany) int _forceAtlDllManifestRTM;
#include <stdint.h>
#if defined(_MSC_VER) && !defined(__MINGW__) && !defined(__MINGW32__)
/* Define these libraries as getting built as DLLs */
#define LIBAUDIOGRAPHER_DLL
#define LIBARDOUR_DLL
#define LIBMIDIPP_DLL
#define LIBPBD_DLL
#define LIBCONTROLCP_DLL
#define LIBGTKMM2EXT_DLL
#define LIBEVORAL_DLL
#if (INCLUDE_ARDOUR_MISCELLANEOUS)
#include <ardourext/misc.h>
#endif

View File

@ -7,7 +7,22 @@
typedef long __suseconds_t;
typedef __suseconds_t suseconds_t;
#endif
#ifndef BUILDING_EVORAL
#include <WinSock2.h> /* gets 'struct timeval' - Changed by JE - 23-07-2013. Was formerly. . . #include <WinSock.h> */
/* For whatever reason, Ardour's 'libevoral' refuses to build as a DLL if we include both 'rpc.h' */
/* and 'WinSock2.h'. It doesn't seem to matter which order we #include them. Given that we can't */
/* edit 'rpc.h' or 'WinSock2.h', just make sure we don't #include them when building libevoral. */
/* Type of the second argument to `getitimer' and
the second and third arguments `setitimer'. */
struct itimerval
{
/* Value to put into `it_value' when the timer expires. */
struct timeval it_interval;
/* Time to the next timer expiration. */
struct timeval it_value;
};
#endif
#ifdef _TIMEVAL_DEFINED
# define _STRUCT_TIMEVAL 1
@ -60,9 +75,18 @@ typedef void *__restrict __timezone_ptr_t;
Returns 0 on success, -1 on errors.
NOTE: This form of timezone information is obsolete.
Use the functions and variables declared in <time.h> instead. */
#ifdef LIBPBD_DLL /* JE - use the version that's available from libpbd */
#ifdef LIBPBD_API
LIBPBD_API int __cdecl gettimeofday (struct timeval *__restrict __tv,
__timezone_ptr_t __tz) __THROW;
#else
__declspec(dllimport) int __cdecl gettimeofday (struct timeval *__restrict __tv,
__timezone_ptr_t __tz) __THROW;
#endif
#else
extern int gettimeofday (struct timeval *__restrict __tv,
__timezone_ptr_t __tz) __THROW;
#endif
extern int getntptimeofday (struct timespec *__restrict __tp,
__timezone_ptr_t __tz) __THROW;
@ -90,16 +114,6 @@ extern int setntptimeofday (__const struct timespec *__tp,
//#define ITIMER_PROF ITIMER_PROF
// };
/* Type of the second argument to `getitimer' and
the second and third arguments `setitimer'. */
struct itimerval
{
/* Value to put into `it_value' when the timer expires. */
struct timeval it_interval;
/* Time to the next timer expiration. */
struct timeval it_value;
};
#if defined __USE_GNU && !defined __cplusplus
/* Use the nicer parameter type only in GNU mode and not for C++ since the
strict C++ rules prevent the automatic promotion. */