Check in some minor modifications (to MSVC specific headers)
authorJohn Emmas <johne53@tiscali.co.uk>
Mon, 13 Jan 2014 10:22:31 +0000 (10:22 +0000)
committerJohn Emmas <johne53@tiscali.co.uk>
Mon, 13 Jan 2014 10:22:31 +0000 (10:22 +0000)
msvc_extra_headers/ardourext/misc.h.input
msvc_extra_headers/ardourext/sys/targetsxs.h.input
msvc_extra_headers/ardourext/sys/time.h.input

index e9e2c94b65508ea02a593b17c9a44ceae1bf9935..79fb5aafab2e4c7894219dc5335e8cf9d5b80d91 100644 (file)
 #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__ */
index d013c2b6bd72820e23f226e2335119ee2af547e8..d10997cf1a416052829dcb9295a112b1178aa876 100644 (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
index 67c0e7d4563cea12588a57763a09c75238ff492f..a0e7ce95f2ac02260a900444189860647d682716 100644 (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.  */