mingw build fixes (tested with i686-w64-mingw32 on linux-x86_64)
authorRobin Gareus <robin@gareus.org>
Tue, 4 Mar 2014 14:25:58 +0000 (15:25 +0100)
committerRobin Gareus <robin@gareus.org>
Tue, 4 Mar 2014 14:25:58 +0000 (15:25 +0100)
24 files changed:
gtk2_ardour/plugin_eq_gui.cc
gtk2_ardour/utils.cc
gtk2_ardour/vst_plugin_ui.cc
gtk2_ardour/windows_vst_plugin_ui.cc
gtk2_ardour/wscript
headless/load_session.cc
libs/ardour/ardour/vst_types.h
libs/ardour/vst_plugin.cc
libs/ardour/vst_search_path.cc
libs/ardour/wscript
libs/canvas/debug.cc
libs/fst/scanner.cc
libs/fst/vstwin.c
libs/fst/wscript
libs/pbd/localtime_r.cc
libs/pbd/pbd/abstract_ui.h
libs/pbd/pbd/localtime_r.h
libs/pbd/pbd/system_exec.h
libs/pbd/windows_special_dirs.cc
libs/pbd/wscript
libs/plugins/reasonablesynth.lv2/lv2.c
libs/surfaces/mackie/strip.cc
libs/surfaces/osc/osc.cc
wscript

index 306746d55666614175e74b7577ad243f74996320..13c475e27c1b4896a7a11b5f58ae18cf8bb12f2e 100644 (file)
 
 */
 
+#include <math.h>
 #include <iostream>
-#include <cmath>
 
 #ifdef COMPILER_MSVC
 #include <float.h>
 /* isinf() & isnan() are C99 standards, which older MSVC doesn't provide */
-#define isinf(val) !((bool)_finite((double)val))
-#define isnan(val) (bool)_isnan((double)val)
-#endif
-
-#ifdef __APPLE__
-#define isinf(val) std::isinf((val))
-#define isnan(val) std::isnan((val))
+#define ISINF(val) !((bool)_finite((double)val))
+#define ISNAN(val) (bool)_isnan((double)val)
+#else
+#define ISINF(val) std::isinf((val))
+#define ISNAN(val) std::isnan((val))
 #endif
 
 #include <gtkmm/box.h>
@@ -777,13 +775,13 @@ PluginEqGui::plot_signal_amplitude_difference(Gtk::Widget *w, cairo_t *cr)
                }
                */
 
-               if (isinf(power)) {
+               if (ISINF(power)) {
                        if (power < 0) {
                                power = _min_dB - 1.0;
                        } else {
                                power = _max_dB - 1.0;
                        }
-               } else if (isnan(power)) {
+               } else if (ISNAN(power)) {
                        power = _min_dB - 1.0;
                }
 
index 777eb6261650bc3c42eec0b58501b343b3e65520..a8b46f1f57853496f91d028ce831208b2e5961ae 100644 (file)
@@ -64,6 +64,10 @@ using Gtkmm2ext::Keyboard;
 
 sigc::signal<void>  DPIReset;
 
+#ifdef PLATFORM_WINDOWS
+#define random() rand()
+#endif
+
 
 /** Add an element to a menu, settings its sensitivity.
  * @param m Menu to add to.
index 35f59a71f5d6fee7ab0e2cb355f629e082ed16cc..3afb17a652734f7428446ea98b89e90d2d1a7a7f 100644 (file)
 
 */
 
+#include <gtkmm.h>
 #include "ardour/vst_plugin.h"
 #include "ardour/vst_types.h"
 #include "vst_plugin_ui.h"
+
+#ifdef PLATFORM_WINDOWS
+#include <gdk/gdkwin32.h>
+#elif defined __APPLE__
+// TODO
+#else
 #include <gdk/gdkx.h>
+#endif
 
 VSTPluginUI::VSTPluginUI (boost::shared_ptr<ARDOUR::PluginInsert> insert, boost::shared_ptr<ARDOUR::VSTPlugin> plugin)
        : PlugUIBase (insert)
index 72e9952dece2d368b1edce9bf9ea9f011442c47e..1ce83f8992bd3b10d159493d44d7636bbf83fce4 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include <fst.h>
+#include <gtkmm.h>
 #include <gtk/gtk.h>
 #include <gtk/gtksocket.h>
 #include "ardour/plugin_insert.h"
 
 #include "windows_vst_plugin_ui.h"
 
-#ifdef GDK_WINDOWING_X11
-#include <gdk/gdkx.h>
-#elif defined GDK_WINDOWING_WIN32
+#ifdef PLATFORM_WINDOWS
 #include <gdk/gdkwin32.h>
-#elif defined GDK_WINDOWING_QUARTZ
-/* not yet supported */
+#elif defined __APPLE__
+// TODO
+#else
+#include <gdk/gdkx.h>
 #endif
 
 using namespace Gtk;
@@ -42,17 +43,21 @@ WindowsVSTPluginUI::WindowsVSTPluginUI (boost::shared_ptr<PluginInsert> pi, boos
 {
 
 #ifdef GDK_WINDOWING_WIN32
-       GtkWindow* wobj = win->gobj();
+
+#if 0 // TODO verify window vs vbox-widget WRT to plugin_analysis_expander
+       GtkWindow* wobj = GTK_WINDOW(gtk_widget_get_toplevel(this->gobj()));
+#else
+       GtkVBox* wobj = this->gobj();
+#endif
+
        gtk_widget_realize(GTK_WIDGET(wobj));
        void* hWndHost = gdk_win32_drawable_get_handle(GTK_WIDGET(wobj)->window);
 
        fst_run_editor (_vst->state(), hWndHost);
 #else
        fst_run_editor (_vst->state(), NULL);
-#endif
-
-
        pack_start (plugin_analysis_expander, true, true);
+#endif
 }
 
 WindowsVSTPluginUI::~WindowsVSTPluginUI ()
index 008b0f48844b4d0ad28c9e8d2be26a6656ad01d0..92f584fc1f8e8389a9a7c728930ba779a53078c8 100644 (file)
@@ -398,14 +398,11 @@ def build(bld):
         obj.source    = gtk2_ardour_sources
         obj.target = 'ardour-' + bld.env['VERSION']
         obj.includes = ['.']
+        obj.ldflags = ['-no-undefined']
 
         if bld.is_defined('WINDOWS_VST_SUPPORT'):
         # Windows VST support mingw
-            obj.source += (
-                '../libs/fst/fst.c',
-                '../libs/fst/vstwin.c',
-                '../vst/winmain.c',
-                )
+            obj.source += [ '../vst/winmain.c' ]
             obj.includes += [ '../libs/fst' ]
 
     # at this point, "obj" refers to either the normal native executable
@@ -459,7 +456,8 @@ def build(bld):
     if bld.is_defined('WINDOWS_VST_SUPPORT'):
         obj.source += [ 'windows_vst_plugin_ui.cc' ]
         obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
-        obj.use += [ 'X11' ]
+        if bld.env['build_target'] != 'mingw':
+            obj.use += [ 'X11' ]
         
     if bld.is_defined('LXVST_SUPPORT'):
         obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
index 20c83ed62856037c300746fdf57a0bb82b8f8a28..dc2644c4288567eb581a44bb022b04e414681f15 100644 (file)
@@ -16,6 +16,10 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
+#ifdef PLATFORM_WINDOWS
+#define sleep(X) Sleep((X) * 1000)
+#endif
+
 static const char* localedir = LOCALEDIR;
 
 TestReceiver test_receiver;
index a393ef2b5ad584d570a19480a3f343a2040ce98a..1b443dc1928396c614e5a571b3e8b0c1b26747a8 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef __ardour_vst_types_h__
 #define __ardour_vst_types_h__
 
+#include <pthread.h>
 #include "ardour/libardour_visibility.h"
 #include "ardour/vestige/aeffectx.h"
 
index 3ea103a7b79b70b81390761d0b115daf63439607..1eb553c073b3901c6076f29cf33c78e945345cec 100644 (file)
@@ -351,29 +351,7 @@ VSTPlugin::load_plugin_preset (PresetRecord r)
 #else
        sscanf (r.uri.c_str(), "VST:%d:%d", &id, &index);
 #endif
-
-#ifdef PLATFORM_WINDOWS
-       int const vst_version = _plugin->dispatcher (_plugin, effGetVstVersion, 0, 0, NULL, 0);
-       if (vst_version >= 2) {
-               _plugin->dispatcher (_plugin, effBeginSetProgram, 0, 0, NULL, 0);
-       }
-
-       _plugin->dispatcher (_plugin, effSetProgram, 0, index, NULL, 0);
-
-       if (vst_version >= 2) {
-               _plugin->dispatcher (_plugin, effEndSetProgram, 0, 0, NULL, 0);
-       }
-
-       //unfortunately, we don't get any opcodes back from the plugin when this happens  (?!)
-       //so we have to manually update param values from the plugin to our listeners
-       for (int n = 0; n < parameter_count(); n++ ) {
-               float p = get_parameter(n);  //ask the plugin what its new setting is
-               Plugin::set_parameter (which, newval);
-       }
-
-#else
        _state->want_program = index;
-#endif
        return true;
 }
 
index 78814306cd956ec57b46eb13af5da306ef34abdc..6dea1b70a7bbeff7dab58e32146f36832529505c 100644 (file)
@@ -24,6 +24,8 @@
 
 #ifdef PLATFORM_WINDOWS
 
+#include <windows.h>
+#include <shlobj.h> // CSIDL_*
 #include "pbd/windows_special_dirs.h"
 
 namespace ARDOUR {
@@ -56,7 +58,7 @@ vst_search_path ()
                        
                        if (p == 0) {
                                char *pVSTx86 = 0;
-                               char *pProgFilesX86 = get_win_special_folder (CSIDL_PROGRAM_FILESX86);
+                               char *pProgFilesX86 = PBD::get_win_special_folder (CSIDL_PROGRAM_FILESX86);
                                
                                if (pProgFilesX86) {
                                        // Look for a VST folder under C:\Program Files (x86)
@@ -75,7 +77,7 @@ vst_search_path ()
                        if (p == 0) {
                                // Look for a VST folder under C:\Program Files
                                char *pVST = 0;
-                               char *pProgFiles = get_win_special_folder (CSIDL_PROGRAM_FILES);
+                               char *pProgFiles = PBD::get_win_special_folder (CSIDL_PROGRAM_FILES);
                                
                                if (pProgFiles) {
                                        if (pVST = g_build_filename (pProgFiles, "Steinberg", "VSTPlugins", 0)) {
@@ -92,7 +94,7 @@ vst_search_path ()
                
                if (p == 0) {
                        // If all else failed, assume the plugins are under "My Documents"
-                       user_home = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
+                       user_home = (char*) g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
                        if (user_home) {
                                p = g_build_filename (user_home, "Plugins", "VST", 0);
                        } else {
@@ -103,7 +105,7 @@ vst_search_path ()
                } else {
                        // Concatenate the registry path with the user's personal path
 
-                       user_home = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
+                       user_home = (char*) g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
                        
                        if (user_home) {
                                p = g_build_path (";", p, g_build_filename(user_home, "Plugins", "VST", 0), 0);
index 10ee3a7dbd82769ce08e49f01a96639b47a5e40a..e13a96b912d47a29226e6151f59b1c0d58b93cee 100644 (file)
@@ -294,7 +294,7 @@ def configure(conf):
 
     # controls whether we actually use it in preference to soundtouch
     # Note: as of 2104, soundtouch (WSOLA) has been out-of-use for years.
-    conf.define('USE_RUBBERBAND', 1)  
+    conf.define('USE_RUBBERBAND', 1)
 
     conf.define('CURRENT_SESSION_FILE_VERSION', CURRENT_SESSION_FILE_VERSION)
 
@@ -315,6 +315,11 @@ def configure(conf):
     autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
     autowaf.check_header(conf, 'cxx', 'boost/scoped_ptr.hpp')
     autowaf.check_header(conf, 'cxx', 'boost/ptr_container/ptr_list.hpp')
+    if conf.env['WINDOWS_VST_SUPPORT'] == True and Options.options.dist_target == 'mingw':
+        conf.check(compiler='cxx',
+                   lib='gdi32',
+                   mandatory=True,
+                   uselib_store='GDI32')
 
 
 def build(bld):
@@ -341,11 +346,13 @@ def build(bld):
     obj.target       = 'ardour'
     obj.uselib       = ['GLIBMM','GTHREAD','AUBIO','SIGCPP','XML','UUID',
                         'SNDFILE','SAMPLERATE','LRDF','AUDIOUNITS',
-                        'OSX','BOOST','CURL','DL','TAGLIB','VAMPSDK','VAMPHOSTSDK','RUBBERBAND']
+                        'OSX','BOOST','CURL','TAGLIB','VAMPSDK','VAMPHOSTSDK','RUBBERBAND']
     obj.use          = ['libpbd','libmidipp','libevoral',
-                        'libaudiographer', 
+                        'libaudiographer',
                         'libtimecode',
                         ]
+    if bld.env['build_target'] != 'mingw':
+        obj.uselib += ['DL']
     if bld.is_defined('USE_EXTERNAL_LIBS'):
         obj.uselib.extend(['VAMPSDK', 'LIBLTC'])
     else:
@@ -367,7 +374,7 @@ def build(bld):
     #obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
 
     if bld.is_defined('HAVE_LILV') :
-        obj.source += ['lv2_plugin.cc', 'lv2_evbuf.c', 'uri_map.cc'] 
+        obj.source += ['lv2_plugin.cc', 'lv2_evbuf.c', 'uri_map.cc']
         obj.uselib += ['LILV']
         if bld.is_defined('HAVE_SUIL'):
             obj.uselib += ['SUIL']
@@ -377,7 +384,8 @@ def build(bld):
         obj.includes += [ '../fst' ]
         obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
         if bld.env['build_target'] == 'mingw':
-            obj.source += [ '../fst/vstwin.c']
+            obj.source += [ '../fst/vstwin.c', '../fst/fst.c']
+            obj.uselib += ['GDI32']
 
     if bld.is_defined('LXVST_SUPPORT'):
         obj.source += [ 'lxvst_plugin.cc', 'linux_vst_support.cc' ]
index 82bceeaf31063f2a64d8c67c1017d4dd89ddde97..1f5de7faeab3b870bf256163137936422c0b9bb0 100644 (file)
@@ -58,6 +58,7 @@ ArdourCanvas::checkpoint (string group, string message)
        map<string, struct timeval>::iterator last = last_time.find (group);
 
        if (last != last_time.end ()) {
+#if 0
                time_t seconds = now.tv_sec - last->second.tv_sec;
                suseconds_t useconds = now.tv_usec - last->second.tv_usec;
                if (useconds < 0) {
@@ -65,6 +66,7 @@ ArdourCanvas::checkpoint (string group, string message)
                        --seconds;
                }
                cout << (now.tv_sec + ((double) now.tv_usec / 1e6)) << " [" << (seconds + ((double) useconds / 1e6)) << "]: " << message << "\n";
+#endif
        } else {
                cout << message << "\n";
        }
index ca95b2547165f65b45b368e1683166891144714d..99177b51db510945956e04c61c7ed4ecaeb82c41 100644 (file)
@@ -4,7 +4,9 @@
 #include <vector>
 
 #include "ardour/filesystem_paths.h"
+#ifdef LXVST_SUPPORT
 #include "ardour/linux_vst_support.h"
+#endif
 #include "ardour/vst_info_file.h"
 
 /* make stupid waf happy.
@@ -16,7 +18,9 @@
  * ...but waf does track include dependencies.
  */
 #include "../ardour/vst_info_file.cc"
+#ifdef LXVST_SUPPORT
 #include "../ardour/linux_vst_support.cc"
+#endif
 #include "../ardour/filesystem_paths.cc"
 #include "../ardour/directory_names.cc"
 #include "../pbd/error.cc"
index d37c5dffbbc58ebb5ad2ec85a06bd51a323c0210..4c4e2888f55e6ccbaeedeb405b4a48167eadc498 100644 (file)
@@ -4,9 +4,9 @@
 
 #ifdef PLATFORM_WINDOWS
 
-#include <ardourext/misc.h>
-#include <ardourext/pthread.h>
+#include <pthread.h>
 static UINT_PTR idle_timer_id   = 0;
+extern char *basename(char *path);
 
 #else /* linux + wine */
 
@@ -116,9 +116,9 @@ idle_hands(
                        }
                }
 
+               pthread_mutex_lock (&fst->lock);
 #ifndef PLATFORM_WINDOWS /* linux + wine */
                /* Dispatch messages to send keypresses to the plugin */
-               pthread_mutex_lock (&fst->lock);
                int i;
 
                for (i = 0; i < fst->n_pending_keys; ++i) {
@@ -141,6 +141,7 @@ idle_hands(
                }
 
                fst->n_pending_keys = 0;
+#endif
 
                /* See comment for maybe_set_program call below */
                maybe_set_program (fst);
@@ -158,7 +159,6 @@ idle_hands(
                        maybe_set_program (fst);
                        fst->program_set_without_editor = 1;
                }
-#endif
 
                pthread_mutex_unlock (&fst->lock);
        }
index e15613d9c08a7e4185e59c718fa2173eb7e9e6da..44ff9a812814037d3b87a4400a50f8caa0ab0d93 100644 (file)
@@ -27,6 +27,11 @@ def configure(conf):
     conf.load('misc')
     conf.load('compiler_cxx')
     autowaf.configure(conf)
+    if conf.env['WINDOWS_VST_SUPPORT'] == True and bld.env['build_target'] == 'mingw':
+        conf.check(compiler='cxx',
+                   lib='gdi32',
+                   mandatory=True,
+                   uselib_store='GDI32')
 
 # Add a waf `feature' to allow compilation of things using winegcc
 from waflib.TaskGen import feature
@@ -59,9 +64,15 @@ def build(bld):
             )
         obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
         obj.target = 'ardour-vst-scanner.exe.so'
+        obj.uselib = ['GIOMM', 'DL']
     else:
         obj = bld (features = 'cxx c cxxprogram')
-        obj.source = ( 'scanner.cc' )
+        if bld.is_defined('WINDOWS_VST_SUPPORT'):
+            obj.source = ( 'scanner.cc', 'fst.c', 'vstwin.c' )
+            obj.uselib = ['GIOMM', 'DL', 'GDI32']
+        else:
+            obj.source = ( 'scanner.cc' )
+            obj.uselib = ['GIOMM', 'DL']
         obj.target = 'ardour-vst-scanner'
 
     obj.includes  = [ '../pbd/', '../ardour/', '.' ]
@@ -72,4 +83,3 @@ def build(bld):
         'PACKAGE="' + I18N_PACKAGE + '"',
         ]
     obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3/fst')
-    obj.uselib       = ['GIOMM', 'DL']
index c72e3eb4584cda14a87be3c710562176bc765c3c..fc16fb08b5f2d2bb179af759ed572d0b912c6b92 100644 (file)
@@ -39,3 +39,19 @@ localtime_r(const time_t *const timep, struct tm *p_tm)
 }
 
 #endif
+
+#ifdef __MINGW64__
+       struct tm *
+__cdecl localtime(const long int *_Time)
+{
+       if (_Time == NULL)
+       {
+               return localtime((const time_t *const)NULL); // Unpredictable behavior in case of _Time == NULL;
+       }
+       else
+       {
+               const time_t tempTime = *_Time;
+               return localtime(&tempTime);
+       }
+}
+#endif
index dc5620b2ef76354358862d03e8a1fcd594fb1c42..04d0a38e85ceb0595d8ded529657fe0d6e398ccd 100644 (file)
@@ -75,7 +75,7 @@ class ABSTRACT_UI_API AbstractUI : public BaseUI
         };
        typedef typename RequestBuffer::rw_vector RequestBufferVector;
 
-#if defined(__MINGW32__) && !defined (__MINGW64__)
+#ifdef COMPILER_MSVC // ?? (not needed for ming32 nor mingw64)
 
        struct pthread_cmp
        {
index ad5b89d1342261d9c8bce623722de0e02bda335c..1e810ec084fd734e7c6eca197597e75a2027d6d4 100644 (file)
@@ -3,11 +3,22 @@
 #include <time.h>
 
 #ifdef COMPILER_MSVC
-       #define localtime_r( _clock, _result ) \
-               ( *(_result) = *localtime( (_clock) ), \
-               (_result) )
-#else
-       extern struct tm *localtime_r(const time_t *const timep, struct tm *p_tm);
+
+#define localtime_r( _clock, _result ) \
+       ( *(_result) = *localtime( (_clock) ), (_result) )
+
+#elif defined __MINGW64__
+
+#  ifdef (localtime_r)
+#  undef localtime_r
+#  endif
+
+// As in 64 bit time_t is 64 bit integer, compiler breaks compilation
+// everytime implicit cast from long int* to time_t* worked in
+// the past (32 bit). To unblock such a cast we added the localtime below:
+extern struct tm *localtime(const long int *_Time);
+extern struct tm *localtime_r(const time_t *const timep, struct tm *p_tm);
+
 #endif
 
 #endif
index f08191654d73eb3a42a9d379145593b1afcb254c..0ca523085ae05991e590f37ad64a410663230d0c 100644 (file)
@@ -30,7 +30,7 @@
 #define STDERR_FILENO 2
 #endif
 
-#if defined (__MINGW64__)
+#ifdef PLATFORM_WINDOWS
 #include <windows.h>
 
 #ifdef interface
index 1a477bad454084df1963872a098e5c1706d9ee6a..5e924f57e1ad35eee3d263d42023776bb4e404c6 100644 (file)
@@ -40,7 +40,7 @@
 //
 
 char *
-get_win_special_folder (int csidl)
+PBD::get_win_special_folder (int csidl)
 {
        wchar_t path[PATH_MAX+1];
        HRESULT hr;
index 77a7d555d4a51f4cc6e092c90ad38cc75683d46e..f424ae4c415ad8a89531810c911ecbb9b70af397 100644 (file)
@@ -106,9 +106,14 @@ def configure(conf):
     # Boost headers
     autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
     autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
+    if conf.env['WINDOWS_VST_SUPPORT'] == True and Options.options.dist_target == 'mingw':
+        conf.check(compiler='cxx',
+                   lib='ole32',
+                   mandatory=True,
+                   uselib_store='OLE')
 
 def build(bld):
-    
+
     # Make signals_generated.h using signals.py
     bld(rule = 'python ${SRC} ${TGT}', source = 'pbd/signals.py', target = 'pbd/signals_generated.h')
 
@@ -143,14 +148,14 @@ def build(bld):
     obj.vnum         = LIBPBD_LIB_VERSION
     obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
     obj.defines     += [ 'PACKAGE="' + I18N_PACKAGE + '"',
-                         'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"' 
+                         'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"'
                          ]
-    
+
     if bld.env['build_target'] == 'x86_64':
         obj.defines += [ 'USE_X86_64_ASM' ]
     if bld.env['build_target'] == 'mingw':
         obj.source += [ 'windows_special_dirs.cc' ]
-        obj.linkflags = ['-lole']
+        obj.uselib += ' OLE'
 
     if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
         # Unit tests
index 586ca54c86a37a32a6e0f6eff3431a94168ba815..87f930b3c4890d99df915de79326685d94148b2b 100644 (file)
@@ -100,7 +100,7 @@ instantiate(const LV2_Descriptor*     descriptor,
   self->synth = synth_alloc();
   synth_init(self->synth, rate);
 
-
+#ifndef PLATFORM_WINDOWS // easter egg is for sane platforms with native support for localtime_r only
   struct tm date;
   time_t now;
   time(&now);
@@ -109,6 +109,7 @@ instantiate(const LV2_Descriptor*     descriptor,
     printf("reasonable synth.lv2 says: happy holidays!\n");
     self->xmas = true;
   }
+#endif
 
   return (LV2_Handle)self;
 }
index 1893e31b8dbf6610aa59341e4910bdf0a81449b1..2b9167e3862d8cde6153756c349c225f1253e509 100644 (file)
@@ -58,6 +58,19 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
+#ifndef timeradd /// only avail with __USE_BSD
+#define timeradd(a,b,result)                         \
+  do {                                               \
+    (result)->tv_sec = (a)->tv_sec + (b)->tv_sec;    \
+    (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
+    if ((result)->tv_usec >= 1000000)                \
+    {                                                \
+      ++(result)->tv_sec;                            \
+      (result)->tv_usec -= 1000000;                  \
+    }                                                \
+  } while (0)
+#endif
+
 #define ui_context() MackieControlProtocol::instance() /* a UICallback-derived object that specifies the event loop for signal handling */
 
 Strip::Strip (Surface& s, const std::string& name, int index, const map<Button::ID,StripButtonInfo>& strip_buttons)
index e252d22e3d7c38fe92d7a8e29b828718e0bb0efb..8bc791a1ee5d762bc8115f8bf0e8941ebe6b3fba 100644 (file)
@@ -24,7 +24,6 @@
 #include <cerrno>
 #include <algorithm>
 
-#include <sys/poll.h>
 #include <unistd.h>
 #include <fcntl.h>
 
diff --git a/wscript b/wscript
index 0ba30eba4f02d75d9879ccd5035e4739fd633254..e9cedd216d114fb66e4100bc75df8251a98d90e9 100644 (file)
--- a/wscript
+++ b/wscript
@@ -740,9 +740,10 @@ def configure(conf):
     if opts.windows_vst:
         conf.define('WINDOWS_VST_SUPPORT', 1)
         conf.env['WINDOWS_VST_SUPPORT'] = True
-        conf.env.append_value('CFLAGS', '-I' + Options.options.wine_include)
-        conf.env.append_value('CXXFLAGS', '-I' + Options.options.wine_include)
-        autowaf.check_header(conf, 'cxx', 'windows.h', mandatory = True)
+        if not Options.options.dist_target == 'mingw':
+            conf.env.append_value('CFLAGS', '-I' + Options.options.wine_include)
+            conf.env.append_value('CXXFLAGS', '-I' + Options.options.wine_include)
+            autowaf.check_header(conf, 'cxx', 'windows.h', mandatory = True)
     if opts.lxvst:
         if sys.platform == 'darwin':
             conf.env['LXVST_SUPPORT'] = False