Browse Source

libjack: fix under clang and maybe other systems

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
77f606cf23
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 35 additions and 30 deletions
  1. +1
    -0
      source/includes/CarlaLibJackHints.h
  2. +11
    -30
      source/libjack/libjack.cpp
  3. +23
    -0
      source/libjack/libjack_base.cpp

+ 1
- 0
source/includes/CarlaLibJackHints.h View File

@@ -58,6 +58,7 @@ enum InterposerCallbacks {

typedef int (*CarlaInterposedCallback)(int, void*);

CARLA_API
int jack_carla_interposed_action(uint action, uint value, void* ptr);

#ifdef __cplusplus


+ 11
- 30
source/libjack/libjack.cpp View File

@@ -26,27 +26,6 @@

// ---------------------------------------------------------------------------------------------------------------------

CARLA_EXPORT
int jack_carla_interposed_action(uint, uint, void*)
{
static bool printWarning = true;

if (printWarning)
{
printWarning = false;
carla_stderr2("Non-exported jack_carla_interposed_action called, this should not happen!!");
carla_stderr("Printing some info:");
carla_stderr("\tLD_LIBRARY_PATH: '%s'", std::getenv("LD_LIBRARY_PATH"));
carla_stderr("\tLD_PRELOAD: '%s'", std::getenv("LD_PRELOAD"));
std::fflush(stderr);
}

// ::kill(::getpid(), SIGKILL);
return 1337;
}

// ---------------------------------------------------------------------------------------------------------------------

CARLA_BACKEND_START_NAMESPACE

// ---------------------------------------------------------------------------------------------------------------------
@@ -216,18 +195,20 @@ public:

fNonRealtimeThread.stopThread(5000);

const CarlaMutexLocker cms(fRealtimeThreadMutex);

for (LinkedList<JackClientState*>::Itenerator it = fClients.begin2(); it.valid(); it.next())
{
JackClientState* const jclient(it.getValue(nullptr));
CARLA_SAFE_ASSERT_CONTINUE(jclient != nullptr);
const CarlaMutexLocker cms(fRealtimeThreadMutex);

delete jclient;
}
for (LinkedList<JackClientState*>::Itenerator it = fClients.begin2(); it.valid(); it.next())
{
JackClientState* const jclient(it.getValue(nullptr));
CARLA_SAFE_ASSERT_CONTINUE(jclient != nullptr);

fClients.clear();
fNewClients.clear();
delete jclient;
}

fClients.clear();
fNewClients.clear();
}

clearSharedMemory();



+ 23
- 0
source/libjack/libjack_base.cpp View File

@@ -17,6 +17,29 @@

#include "libjack.hpp"

// ---------------------------------------------------------------------------------------------------------------------

CARLA_EXPORT
int jack_carla_interposed_action(uint, uint, void*)
{
static bool printWarning = true;

if (printWarning)
{
printWarning = false;
carla_stderr2("Non-exported jack_carla_interposed_action called, this should not happen!!");
carla_stderr("Printing some info:");
carla_stderr("\tLD_LIBRARY_PATH: '%s'", std::getenv("LD_LIBRARY_PATH"));
carla_stderr("\tLD_PRELOAD: '%s'", std::getenv("LD_PRELOAD"));
std::fflush(stderr);
}

// ::kill(::getpid(), SIGKILL);
return 1337;
}

// --------------------------------------------------------------------------------------------------------------------

CARLA_BACKEND_USE_NAMESPACE

// --------------------------------------------------------------------------------------------------------------------


Loading…
Cancel
Save