commit 09a64663544aa9418ef9cfbf590d404c7a21649f
parent 0c908bc93b745d3c806688be2467af2c27fad36b
Author: cfillion <cfillion@users.noreply.github.com>
Date: Fri, 20 Nov 2020 08:13:49 -0500
add support for macOS ARM64
Diffstat:
4 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/src/dialog.cpp b/src/dialog.cpp
@@ -318,7 +318,10 @@ void Dialog::setClipboard(const std::string &text)
#ifdef _WIN32
SetClipboardData(CF_UNICODETEXT, mem);
#else
- SetClipboardData(CF_TEXT, mem);
+ // using RegisterClipboardFormat instead of CF_TEXT for compatibility with REAPER v5
+ // (prior to WDL commit 0f77b72adf1cdbe98fd56feb41eb097a8fac5681)
+ const unsigned int fmt = RegisterClipboardFormat("SWELL__CF_TEXT");
+ SetClipboardData(fmt, mem);
#endif
CloseClipboard();
}
diff --git a/src/platform.cpp b/src/platform.cpp
@@ -26,6 +26,8 @@ const Platform::Enum Platform::Current = Platform::
Darwin_x86_64
# elif __i386__
Darwin_i386
+# elif __arm64__
+ Darwin_arm64
# else
Unknown
# endif
@@ -66,6 +68,7 @@ auto Platform::parse(const char *platform) -> Enum
{ "darwin", Darwin_Any },
{ "darwin32", Darwin_i386 },
{ "darwin64", Darwin_x86_64 },
+ { "darwin-arm64", Darwin_arm64 },
{ "linux", Linux_Any },
{ "linux32", Linux_i686 },
diff --git a/src/platform.hpp b/src/platform.hpp
@@ -25,16 +25,17 @@ public:
Darwin_i386 = 1<<0,
Darwin_x86_64 = 1<<1,
- Darwin_Any = Darwin_i386 | Darwin_x86_64,
+ Darwin_arm64 = 1<<2,
+ Darwin_Any = Darwin_i386 | Darwin_x86_64 | Darwin_arm64,
- Linux_i686 = 1<<2,
- Linux_x86_64 = 1<<3,
- Linux_armv7l = 1<<4,
- Linux_aarch64 = 1<<5,
+ Linux_i686 = 1<<3,
+ Linux_x86_64 = 1<<4,
+ Linux_armv7l = 1<<5,
+ Linux_aarch64 = 1<<6,
Linux_Any = Linux_i686 | Linux_x86_64 | Linux_armv7l | Linux_aarch64,
- Windows_x86 = 1<<6,
- Windows_x64 = 1<<7,
+ Windows_x86 = 1<<7,
+ Windows_x64 = 1<<8,
Windows_Any = Windows_x86 | Windows_x64,
Generic = Darwin_Any | Linux_Any | Windows_Any,
diff --git a/test/platform.cpp b/test/platform.cpp
@@ -26,9 +26,10 @@ TEST_CASE("platform from string", M) {
}
SECTION("macOS") {
- REQUIRE(Platform("darwin") == Platform::Darwin_Any);
- REQUIRE(Platform("darwin32") == Platform::Darwin_i386);
- REQUIRE(Platform("darwin64") == Platform::Darwin_x86_64);
+ REQUIRE(Platform("darwin") == Platform::Darwin_Any);
+ REQUIRE(Platform("darwin32") == Platform::Darwin_i386);
+ REQUIRE(Platform("darwin64") == Platform::Darwin_x86_64);
+ REQUIRE(Platform("darwin-arm64") == Platform::Darwin_arm64);
}
SECTION("linux") {
@@ -59,9 +60,15 @@ TEST_CASE("test platform", M) {
# ifdef __x86_64__
{Platform::Darwin_i386, false},
{Platform::Darwin_x86_64, true },
+ {Platform::Darwin_arm64, false},
# elif __i386__
{Platform::Darwin_i386, true },
{Platform::Darwin_x86_64, false},
+ {Platform::Darwin_arm64, false},
+# elif __arm64__
+ {Platform::Darwin_i386, false},
+ {Platform::Darwin_x86_64, false},
+ {Platform::Darwin_arm64, true },
# else
# error Untested architecture
# endif
@@ -70,6 +77,7 @@ TEST_CASE("test platform", M) {
{Platform::Darwin_Any, false},
{Platform::Darwin_i386, false},
{Platform::Darwin_x86_64, false},
+ {Platform::Darwin_arm64, false},
{Platform::Windows_Any, false},
{Platform::Windows_x86, false},
{Platform::Windows_x64, false},
@@ -103,6 +111,7 @@ TEST_CASE("test platform", M) {
{Platform::Darwin_Any, false},
{Platform::Darwin_i386, false},
{Platform::Darwin_x86_64, false},
+ {Platform::Darwin_arm64, false},
{Platform::Linux_Any, false},
{Platform::Linux_x86_64, false},
{Platform::Linux_i686, false},