Patch Win32 module loading to use Boost.Filesystem

C++17's `<filesystem>` header still doesn't seem to work with winegcc.
This commit is contained in:
Robbert van der Helm
2020-12-02 19:43:34 +01:00
parent 0b462c034e
commit ebc7802c08
3 changed files with 9 additions and 5 deletions
+7
View File
@@ -63,6 +63,13 @@ replace_char16 "using Converter = std::wstring_convert<std::codecvt_utf8_utf16<c
# version here is trying to do something funky
sed -i 's/\b__MINGW32__\b/__NOPE__/g' "$sdk_directory/pluginterfaces/base/funknown.cpp"
# libstdc++fs doesn't work under Winelib, for whatever reason that might be.
# We'll patch the Win32 module loading to use Boost.Filesystem instead.
sed -i 's/^#include <\(experimental\/\)\?filesystem>$/#include <boost\/filesystem.hpp>/' "$sdk_directory/public.sdk/source/vst/hosting/module_win32.cpp"
sed -i 's/^using namespace std\(::experimental\)\?;$/namespace filesystem = boost::filesystem;/' "$sdk_directory/public.sdk/source/vst/hosting/module_win32.cpp"
sed -i 's/\bfile_type::directory\b/file_type::directory_file/g' "$sdk_directory/public.sdk/source/vst/hosting/module_win32.cpp"
sed -i 's/\bp\.native ()/p.wstring ()/g' "$sdk_directory/public.sdk/source/vst/hosting/module_win32.cpp"
# Don't try adding `std::u8string` to an `std::vector<std::string>`. MSVC
# probably coerces them, but GCC doesn't
sed -i 's/\bgeneric_u8string\b/generic_string/g' "$sdk_directory/public.sdk/source/vst/hosting/module_win32.cpp"