From f24e5317cd7b57c8ab36b0987ec29a5579cd5dd2 Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 14 Feb 2022 02:26:09 +0000 Subject: [PATCH] Fix VST3 bundle find on Windows Signed-off-by: falkTX --- distrho/src/DistrhoPluginVST3.cpp | 4 ++-- distrho/src/DistrhoUtils.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/distrho/src/DistrhoPluginVST3.cpp b/distrho/src/DistrhoPluginVST3.cpp index 9abeb858..8033483a 100644 --- a/distrho/src/DistrhoPluginVST3.cpp +++ b/distrho/src/DistrhoPluginVST3.cpp @@ -4216,9 +4216,9 @@ bool ENTRYFNNAME(void*) String tmpPath(getBinaryFilename()); tmpPath.truncate(tmpPath.rfind(DISTRHO_OS_SEP)); tmpPath.truncate(tmpPath.rfind(DISTRHO_OS_SEP)); - DISTRHO_SAFE_ASSERT_RETURN(tmpPath.endsWith("/Contents"), true); + DISTRHO_SAFE_ASSERT_RETURN(tmpPath.endsWith(DISTRHO_OS_SEP_STR "Contents"), true); - tmpPath.truncate(tmpPath.rfind('/')); + tmpPath.truncate(tmpPath.rfind(DISTRHO_OS_SEP)); bundlePath = tmpPath; d_nextBundlePath = bundlePath.buffer(); } diff --git a/distrho/src/DistrhoUtils.cpp b/distrho/src/DistrhoUtils.cpp index d19343fa..7aaed1a2 100644 --- a/distrho/src/DistrhoUtils.cpp +++ b/distrho/src/DistrhoUtils.cpp @@ -59,7 +59,7 @@ const char* getBinaryFilename() # endif CHAR filenameBuf[MAX_PATH]; filenameBuf[0] = '\0'; - GetModuleFileName(hInstance, filenameBuf, sizeof(filenameBuf)); + GetModuleFileNameA(hInstance, filenameBuf, sizeof(filenameBuf)); filename = filenameBuf; #elif !defined(STATIC_BUILD) Dl_info info;