summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2014-03-18 17:32:39 +0000
committerJohn Emmas <johne53@tiscali.co.uk>2014-03-18 17:32:39 +0000
commit80e1b42ed5f21f85f420aa5056e806f61e3ed036 (patch)
tree711dac7a375fac3f08e99db9f1cd7bd303fadc46
parent3e4278a0fb91f1548aaba0d2e881568867987c48 (diff)
When finding (MSVC built) panner DLLs, make sure we only find ones that match our build target
Will most likely also need to get done for similarly "discovered" DLLs (backends / surfaces etc). TBC
-rw-r--r--libs/ardour/panner_manager.cc19
-rw-r--r--msvc_extra_headers/ardourext/sys/targetsxs.h.input5
2 files changed, 23 insertions, 1 deletions
diff --git a/libs/ardour/panner_manager.cc b/libs/ardour/panner_manager.cc
index 00329c7bbe..b14c7c79cf 100644
--- a/libs/ardour/panner_manager.cc
+++ b/libs/ardour/panner_manager.cc
@@ -63,7 +63,24 @@ PannerManager::instance ()
static bool panner_filter (const string& str, void */*arg*/)
{
-#ifdef __APPLE__
+#ifdef COMPILER_MSVC
+ /**
+ * Different build targets (Debug / Release etc) use different versions
+ * of the 'C' runtime (which can't be 'mixed & matched'). Therefore, in
+ * case the supplied search path contains multiple version(s) of a given
+ * panner module, only select the one(s) which match the current build
+ * target (otherwise, all hell will break loose !!)
+ */
+ #if defined (_DEBUG)
+ return str.length() > 12 && (str.find ("panner_") == 0) && (str.find ("D.dll") == (str.length() - 5));
+ #elif defined (RDC_BUILD)
+ return str.length() > 14 && (str.find ("panner_") == 0) && (str.find ("RDC.dll") == (str.length() - 7));
+ #elif defined (_WIN64)
+ return str.length() > 13 && (str.find ("panner_") == 0) && (str.find ("64.dll") == (str.length() - 6));
+ #else
+ return str.length() > 13 && (str.find ("panner_") == 0) && (str.find ("32.dll") == (str.length() - 6));
+ #endif
+#elif defined (__APPLE__)
return str[0] != '.' && (str.length() > 6 && str.find (".dylib") == (str.length() - 6));
#else
return str[0] != '.' && (str.length() > 3 && (str.find (".so") == (str.length() - 3) || str.find (".dll") == (str.length() - 4)));
diff --git a/msvc_extra_headers/ardourext/sys/targetsxs.h.input b/msvc_extra_headers/ardourext/sys/targetsxs.h.input
index 51177b6375..8fbf1327f8 100644
--- a/msvc_extra_headers/ardourext/sys/targetsxs.h.input
+++ b/msvc_extra_headers/ardourext/sys/targetsxs.h.input
@@ -29,6 +29,11 @@
/* #define to zero for a more conventional Debug build */
#endif
+#if !defined(DEBUG) && !defined(NDEBUG)
+/* Assume a debuggable Release build (RDC build) */
+#define RDC_BUILD 1
+#endif
+
#ifndef __midl
#if defined(_DEBUG) || defined (DEBUG)
/* Experimental - link to the lowest DebugCRT so we can run on another system */