fix crash when copy'ing latent plugins
[ardour.git] / libs / backends / jack / weak_libjack.c
index 02705f44affece3786b656ca94e7ba91aa6c32aa..885ca60f54b213c8f0c54713131ac1bef0601e82 100644 (file)
@@ -69,7 +69,7 @@ typedef void * __attribute__ ((__may_alias__)) pvoid_t;
                        fprintf(stderr, "*** WEAK-JACK: required symbol 'jack_%s' was not found\n", "" # SYM); \
                } \
                err |= FAIL; \
-       if (!_j._ ## SYM) err |= FAIL;
+       }
 #endif
 
 typedef void (* func_t) (void);
@@ -110,7 +110,7 @@ static void init_weak_jack(void)
                lib = lib_open("/usr/local/lib/libjack.dylib");
        }
 #elif (defined PLATFORM_WINDOWS)
-# ifdef __x86_64__
+# if ( defined(__x86_64__) || defined(_M_X64) )
        lib = lib_open("libjack64.dll");
 # else
        lib = lib_open("libjack.dll");
@@ -191,6 +191,9 @@ int have_libjack (void) {
 
 /* dedicated support for jack_client_open(,..) variable arg function macro */
 func_t WJACK_get_client_open(void) {
+       if (_status == -1) {
+               init_weak_jack();
+       }
        return _j._client_open;
 }