devel/juce: Add FreeBSD compatibility patches

This commit is contained in:
Yuri Victorovich 2023-06-09 00:07:20 -07:00
parent 1ffb22b000
commit bc8d274922
3 changed files with 76 additions and 0 deletions

View file

@ -1,5 +1,6 @@
PORTNAME= juce
DISTVERSION= 7.0.5
PORTREVISION= 1
CATEGORIES= devel
MAINTAINER= yuri@FreeBSD.org

View file

@ -0,0 +1,46 @@
--- modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/fplatform.h.orig 2023-01-25 11:45:10 UTC
+++ modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/fplatform.h
@@ -139,6 +139,43 @@
#define SMTG_HAS_NOEXCEPT 1
#endif
//-----------------------------------------------------------------------------
+// BSD
+//-----------------------------------------------------------------------------
+#elif __FreeBSD__
+ #define SMTG_OS_LINUX 1 // atomic operations need to be implemented
+ #define SMTG_OS_MACOS 0
+ #define SMTG_OS_WINDOWS 0
+ #define SMTG_OS_IOS 0
+ #define SMTG_OS_OSX 0
+
+ #include <sys/endian.h>
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+ #define BYTEORDER kLittleEndian
+ #else
+ #define BYTEORDER kBigEndian
+ #endif
+
+ #define COM_COMPATIBLE 0
+ #define PLUGIN_API
+ #define SMTG_PTHREADS 1
+
+ #define SMTG_EXPORT_SYMBOL __attribute__ ((visibility ("default")))
+
+ #if __LP64__
+ #define SMTG_PLATFORM_64 1
+ #else
+ #define SMTG_PLATFORM_64 0
+ #endif
+ #ifdef __cplusplus
+ #include <cstddef>
+ #define SMTG_CPP11 (__cplusplus >= 201103L)
+ #ifndef SMTG_CPP11
+ #error unsupported compiler
+ #endif
+ #define SMTG_CPP11_STDLIBSUPPORT 1
+ #define SMTG_HAS_NOEXCEPT 1
+ #endif
+//-----------------------------------------------------------------------------
// Mac and iOS
//-----------------------------------------------------------------------------
#elif __APPLE__

View file

@ -0,0 +1,29 @@
--- modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/funknown.cpp.orig 2023-03-05 05:39:00 UTC
+++ modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/funknown.cpp
@@ -44,7 +44,7 @@
#endif // !SMTG_USE_STDATOMIC_H
#endif // SMTG_OS_MACOS
-#if SMTG_OS_LINUX
+#if SMTG_OS_LINUX && !JUCE_BSD
#if !defined (SMTG_USE_STDATOMIC_H)
#if defined (__ANDROID__) || defined(_LIBCPP_VERSION)
#define SMTG_USE_STDATOMIC_H 1
@@ -100,7 +100,7 @@ int32 PLUGIN_API atomicAdd (int32& var, int32 d)
return OSAtomicAdd32Barrier (d, (int32_t*)&var);
#elif defined(__ANDROID__)
return atomic_fetch_add ((atomic_int*)&var, d) + d;
-#elif SMTG_OS_LINUX
+#elif SMTG_OS_LINUX && !JUCE_BSD
__gnu_cxx::__atomic_add (&var, d);
return var;
#else
@@ -177,7 +177,7 @@ bool FUID::generate ()
}
return false;
-#elif SMTG_OS_LINUX
+#elif SMTG_OS_LINUX && !JUCE_BSD
srand ((size_t)this);
for (int32 i = 0; i < 16; i++)
data[i] = static_cast<unsigned char>(rand ());