mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-12 01:26:31 +01:00
add explicit construction (for MSVC) and some debug messages
This commit is contained in:
parent
25a6aa57a3
commit
5e7f935a27
2 changed files with 18 additions and 5 deletions
|
|
@ -84,15 +84,15 @@ static struct WeakJack {
|
||||||
|
|
||||||
static int _status = -1;
|
static int _status = -1;
|
||||||
|
|
||||||
int have_libjack (void) {
|
|
||||||
return _status;
|
|
||||||
}
|
|
||||||
|
|
||||||
__attribute__((constructor))
|
__attribute__((constructor))
|
||||||
|
//__attribute__((constructor))
|
||||||
static void init_weak_jack(void)
|
static void init_weak_jack(void)
|
||||||
{
|
{
|
||||||
void* lib;
|
void* lib;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
#ifndef NDEBUG
|
||||||
|
fprintf(stderr, "*** WEAK-JACK: initializing\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
memset(&_j, 0, sizeof(_j));
|
memset(&_j, 0, sizeof(_j));
|
||||||
|
|
||||||
|
|
@ -111,6 +111,9 @@ static void init_weak_jack(void)
|
||||||
lib = lib_open("libjack.so.0");
|
lib = lib_open("libjack.so.0");
|
||||||
#endif
|
#endif
|
||||||
if (!lib) {
|
if (!lib) {
|
||||||
|
#ifndef NDEBUG
|
||||||
|
fprintf(stderr, "*** WEAK-JACK: libjack was not found\n");
|
||||||
|
#endif
|
||||||
_status = -2;
|
_status = -2;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -135,6 +138,16 @@ static void init_weak_jack(void)
|
||||||
_j._client_open = NULL;
|
_j._client_open = NULL;
|
||||||
}
|
}
|
||||||
_status = err;
|
_status = err;
|
||||||
|
#ifndef NDEBUG
|
||||||
|
fprintf(stderr, "*** WEAK-JACK: %s. (%d)\n", err ? "jack is not available" : "OK", _status);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int have_libjack (void) {
|
||||||
|
if (_status == -1) {
|
||||||
|
init_weak_jack();
|
||||||
|
}
|
||||||
|
return _status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
* see https://en.wikibooks.org/wiki/C_Programming/Preprocessor#X-Macros
|
* see https://en.wikibooks.org/wiki/C_Programming/Preprocessor#X-Macros
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef USE_WEAK_JACK
|
#ifdef USE_WEAK_JACK
|
||||||
|
|
||||||
/* <jack/jack.h> */
|
/* <jack/jack.h> */
|
||||||
JCFUN(1, int, client_close, 0)
|
JCFUN(1, int, client_close, 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue