diff --git a/lib-src/libnyquist/nyquist/cmt/cmtcmd.c b/lib-src/libnyquist/nyquist/cmt/cmtcmd.c index 28814678d..311a5876a 100644 --- a/lib-src/libnyquist/nyquist/cmt/cmtcmd.c +++ b/lib-src/libnyquist/nyquist/cmt/cmtcmd.c @@ -14,7 +14,7 @@ #define HASHELEM(p) ((p).symbol_name) #define HASHVAL 50 #define HASHENTRIES 50 -#define HASHENTER lookup +#define HASHENTER hash_lookup #define HASHNOCOPY #include "hashrout.h" @@ -23,7 +23,7 @@ void defvar(name, addr) char *name; int *addr; { - int i = lookup(name); + int i = hash_lookup(name); HASHENTRY(i).symb_type = var_symb_type; HASHENTRY(i).ptr.intptr = addr; } @@ -33,7 +33,7 @@ void defun(name, addr) char *name; int (*addr)(); { - int i = lookup(name); + int i = hash_lookup(name); HASHENTRY(i).symb_type = fn_symb_type; HASHENTRY(i).ptr.routine = addr; } @@ -44,7 +44,7 @@ void defvec(name, addr, size) int *addr; int size; { - int i = lookup(name); + int i = hash_lookup(name); HASHENTRY(i).symb_type = vec_symb_type; HASHENTRY(i).size = size; HASHENTRY(i).ptr.intptr = addr; diff --git a/lib-src/libnyquist/nyquist/cmt/cmtcmd.h b/lib-src/libnyquist/nyquist/cmt/cmtcmd.h index 9ad1cac31..22a64620a 100644 --- a/lib-src/libnyquist/nyquist/cmt/cmtcmd.h +++ b/lib-src/libnyquist/nyquist/cmt/cmtcmd.h @@ -25,7 +25,7 @@ typedef struct symb_descr { } ptr; } symb_descr_node; -int lookup(char *s); +int hash_lookup(char *s); void defvar(char *name, int *addr); void defvec(char *name, int *addr, int size); typedef int (*defun_type)(); diff --git a/lib-src/libnyquist/nyquist/cmt/seqread.c b/lib-src/libnyquist/nyquist/cmt/seqread.c index 62d759d97..ab785f392 100644 --- a/lib-src/libnyquist/nyquist/cmt/seqread.c +++ b/lib-src/libnyquist/nyquist/cmt/seqread.c @@ -471,7 +471,7 @@ private void docall() if (fieldx == 1) fferror("Routine name expected"); else if (token[fieldx] != '(') fferror("Open paren expected"); else { - desc = &HASHENTRY(lookup(symbol)); + desc = &HASHENTRY(hash_lookup(symbol)); if (!desc->symb_type) { fieldx = 0; fferror("Function not defined"); @@ -1038,7 +1038,7 @@ private void doset(vec_flag) linex += scan(); if (!token[0]) fferror("Variable name expected"); else { - struct symb_descr *desc = &HASHENTRY(lookup(token)); + struct symb_descr *desc = &HASHENTRY(hash_lookup(token)); if (!desc->symb_type) fferror("Called function not defined"); else if (vec_flag && (desc->symb_type != vec_symb_type)) { fferror("This is not an array"); diff --git a/src/effects/ladspa/LadspaEffect.cpp b/src/effects/ladspa/LadspaEffect.cpp index 4e888c673..db9837a48 100644 --- a/src/effects/ladspa/LadspaEffect.cpp +++ b/src/effects/ladspa/LadspaEffect.cpp @@ -27,6 +27,14 @@ effects from this one class. #include +#if !defined(__WXMSW__) +#include + +#ifndef RTLD_DEEPBIND +#define RTLD_DEEPBIND 0 +#endif +#endif + #include // for wxUSE_* macros #include #include @@ -260,11 +268,18 @@ unsigned LadspaEffectsModule::DiscoverPluginsAtPath( int index = 0; int nLoaded = 0; LADSPA_Descriptor_Function mainFn = NULL; +#if defined(__WXMSW__) wxDynamicLibrary lib; if (lib.Load(path, wxDL_NOW)) { wxLogNull logNo; mainFn = (LADSPA_Descriptor_Function) lib.GetSymbol(wxT("ladspa_descriptor")); +#else + void *lib = dlopen((const char *)path.ToUTF8(), RTLD_NOW | RTLD_LOCAL | RTLD_DEEPBIND); + if (lib) { + mainFn = (LADSPA_Descriptor_Function) dlsym(lib, "ladspa_descriptor"); +#endif + if (mainFn) { const LADSPA_Descriptor *data; @@ -283,6 +298,7 @@ unsigned LadspaEffectsModule::DiscoverPluginsAtPath( else errMsg = _("Could not load the library"); +#if defined(__WXMSW__) if (lib.IsLoaded()) { // PRL: I suspect Bug1257 -- Crash when enabling Amplio2 -- is the fault of a timing- // dependent multi-threading bug in the Amplio2 library itself, in case the unload of the .dll @@ -291,6 +307,11 @@ unsigned LadspaEffectsModule::DiscoverPluginsAtPath( ::wxMilliSleep(10); lib.Unload(); } +#else + if (lib) { + dlclose(lib); + } +#endif wxSetWorkingDirectory(saveOldCWD); hadpath ? wxSetEnv(wxT("PATH"), envpath) : wxUnsetEnv(wxT("PATH")); @@ -355,8 +376,12 @@ FilePaths LadspaEffectsModule::GetSearchPaths() // No special paths...probably should look in %CommonProgramFiles%\LADSPA #else - + pathList.push_back(wxGetHomeDir() + wxFILE_SEP_PATH + wxT(".ladspa")); +#if defined(__LP64__) + pathList.push_back(wxT("/usr/local/lib64/ladspa")); + pathList.push_back(wxT("/usr/lib64/ladspa")); +#endif pathList.push_back(wxT("/usr/local/lib/ladspa")); pathList.push_back(wxT("/usr/lib/ladspa")); pathList.push_back(wxT(LIBDIR) wxT("/ladspa"));