Browse Source

JackWeakAPI: call tryload_libjack if it hasn't been called already

On non-Windows tryload_libjack is loaded on startup with
__attribute__((constructor)) but with MSVC, Microsoft documentation
says to not load libraries in a DLL's initialization function:
https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-best-practices
pull/846/head
Be 3 years ago
parent
commit
d2fc69ac26
No known key found for this signature in database GPG Key ID: F4D83691462F656E
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      common/JackWeakAPI.c

+ 5
- 2
common/JackWeakAPI.c View File

@@ -77,8 +77,11 @@ void *load_jack_function(const char *fn_name)
{
void *fn = 0;
if (!libjack_handle) {
fprintf (stderr, "libjack not found, so do not try to load %s ffs !\n", fn_name);
return 0;
tryload_libjack();
if (!libjack_handle) {
fprintf (stderr, "libjack not found, so do not try to load %s ffs !\n", fn_name);
return 0;
}
}
#ifdef WIN32
fn = (void*)GetProcAddress(libjack_handle, fn_name);


Loading…
Cancel
Save