1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

VST3: Patch moduleinfotool sources to allow building on more platforms

This commit is contained in:
reuk 2023-04-20 20:08:08 +01:00
parent 417f0e9ca3
commit 89f4657bee
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
6 changed files with 44 additions and 13 deletions

View file

@ -4,3 +4,22 @@ inclusion in JUCE.
- `#warning` directives were removed from fstring.cpp, as these cannot be
silenced with a `pragma GCC diagnostic ignored "-Wcpp"` when building with
g++.
- The version check in module_linux.cpp was changed to match the number
corresponding to the C++17 standard.
- The <limits> header was included in moduleinfoparser.cpp in order to make
std::numeric_limits visible when building with the GNU stdlib.
- Loop variable types were adjusted in moduleinfoparser.cpp to avoid forming
references to temporary values, which produced -Wrange-loop-bind-reference
warnings when building with Xcode.
- The <cstdint> header was included in moduleinfo.h in order to make uint32_t
visible when building with the GNU stdlib.
- helper.manifest was added, to be included in the moduleinfo tool in order to
force UTF-8 mode on Windows.
- std:: qualification was added to std::move call in module.cpp to silence
a -Wunqualified-std-cast-call warning

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity type="win32" name="juce_vst3_helper" version="6.0.0.0"/>
<application>
<windowsSettings>
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
</windowsSettings>
</application>
</assembly>

View file

@ -270,7 +270,7 @@ void ClassInfo::parseSubCategories (const std::string& str) noexcept
std::stringstream stream (str);
std::string item;
while (std::getline (stream, item, '|'))
data.subCategories.emplace_back (move (item));
data.subCategories.emplace_back (std::move (item));
}
//------------------------------------------------------------------------

View file

@ -43,7 +43,7 @@
#include <sys/utsname.h>
#include <unistd.h>
#if (__cplusplus >= 201707L)
#if (__cplusplus >= 201703L)
#if __has_include(<filesystem>)
#define USE_EXPERIMENTAL_FS 0
#elif __has_include(<experimental/filesystem>)

View file

@ -37,6 +37,7 @@
#pragma once
#include <cstdint>
#include <string>
#include <vector>

View file

@ -39,6 +39,7 @@
#include "jsoncxx.h"
#include "pluginterfaces/base/ipluginbase.h"
#include <stdexcept>
#include <limits>
//------------------------------------------------------------------------
namespace Steinberg::ModuleInfoLib {
@ -140,7 +141,7 @@ struct ModuleInfoJsonParser
uint32_t parsed {0};
if (auto obj = value.asObject ())
{
for (const auto& el : *obj)
for (const auto el : *obj)
{
auto elementName = el.name ().text ();
if (elementName == "Vendor")
@ -171,7 +172,7 @@ struct ModuleInfoJsonParser
auto flags = el.value ().asObject ();
if (!flags)
throw parse_error ("Expect 'Flags' to be a JSON Object", el.name ());
for (const auto& flag : *flags)
for (const auto flag : *flags)
{
auto flagName = flag.name ().text ();
auto flagValue = flag.value ().asBoolean ();
@ -228,7 +229,7 @@ struct ModuleInfoJsonParser
auto array = value.asArray ();
if (!array)
throw parse_error ("Expect Classes Array", value);
for (const auto& classInfoEl : *array)
for (const auto classInfoEl : *array)
{
auto classInfo = classInfoEl.value ().asObject ();
if (!classInfo)
@ -238,7 +239,7 @@ struct ModuleInfoJsonParser
uint32_t parsed {0};
for (const auto& el : *classInfo)
for (const auto el : *classInfo)
{
auto elementName = el.name ().text ();
if (elementName == "CID")
@ -290,7 +291,7 @@ struct ModuleInfoJsonParser
auto subCatArr = el.value ().asArray ();
if (!subCatArr)
throw parse_error ("Expect Array here", el.value ());
for (const auto& catEl : *subCatArr)
for (const auto catEl : *subCatArr)
{
auto cat = getText (catEl.value ());
ci.subCategories.emplace_back (cat);
@ -318,13 +319,13 @@ struct ModuleInfoJsonParser
auto snapArr = el.value ().asArray ();
if (!snapArr)
throw parse_error ("Expect Array here", el.value ());
for (const auto& snapEl : *snapArr)
for (const auto snapEl : *snapArr)
{
auto snap = snapEl.value ().asObject ();
if (!snap)
throw parse_error ("Expect Object here", snapEl.value ());
ModuleInfo::Snapshot snapshot;
for (const auto& spEl : *snap)
for (const auto spEl : *snap)
{
auto spElName = spEl.name ().text ();
if (spElName == "Path")
@ -368,14 +369,14 @@ struct ModuleInfoJsonParser
auto arr = value.asArray ();
if (!arr)
throw parse_error ("Expect Array here", value);
for (const auto& el : *arr)
for (const auto el : *arr)
{
auto obj = el.value ().asObject ();
if (!obj)
throw parse_error ("Expect Object here", el.value ());
ModuleInfo::Compatibility compat;
for (const auto& objEl : *obj)
for (const auto objEl : *obj)
{
auto elementName = objEl.name ().text ();
if (elementName == "New")
@ -385,7 +386,7 @@ struct ModuleInfoJsonParser
auto oldElArr = objEl.value ().asArray ();
if (!oldElArr)
throw parse_error ("Expect Array here", objEl.value ());
for (const auto& old : *oldElArr)
for (const auto old : *oldElArr)
{
compat.oldCID.emplace_back (getText (old.value ()));
}
@ -415,7 +416,7 @@ struct ModuleInfoJsonParser
};
uint32_t parsed {0};
for (const auto& el : *docObj)
for (const auto el : *docObj)
{
auto elementName = el.name ().text ();
if (elementName == "Name")