diff --git a/modules/juce_core/juce_core.cpp b/modules/juce_core/juce_core.cpp index 8382283f918..e7d7e69a5fc 100644 --- a/modules/juce_core/juce_core.cpp +++ b/modules/juce_core/juce_core.cpp @@ -108,7 +108,7 @@ #include #include - #if ! (JUCE_ANDROID || JUCE_WASM) + #if ! (JUCE_ANDROID || JUCE_WASM || JUCE_MUSL) #include #endif #endif diff --git a/modules/juce_core/native/juce_SharedCode_posix.h b/modules/juce_core/native/juce_SharedCode_posix.h index c53ef0fff6f..ba9f4c5e8f8 100644 --- a/modules/juce_core/native/juce_SharedCode_posix.h +++ b/modules/juce_core/native/juce_SharedCode_posix.h @@ -178,7 +178,7 @@ inline int juce_siginterrupt ([[maybe_unused]] int sig, [[maybe_unused]] int fla //============================================================================== namespace { - #if JUCE_LINUX || (JUCE_IOS && (! TARGET_OS_MACCATALYST) && (! __DARWIN_ONLY_64_BIT_INO_T)) // (this iOS stuff is to avoid a simulator bug) + #if JUCE_GLIBC || (JUCE_IOS && (! TARGET_OS_MACCATALYST) && (! __DARWIN_ONLY_64_BIT_INO_T)) // (this iOS stuff is to avoid a simulator bug) using juce_statStruct = struct stat64; #define JUCE_STAT stat64 #else diff --git a/modules/juce_core/native/juce_SystemStats_linux.cpp b/modules/juce_core/native/juce_SystemStats_linux.cpp index 3d6bebc74c9..6a21c6fbd56 100644 --- a/modules/juce_core/native/juce_SystemStats_linux.cpp +++ b/modules/juce_core/native/juce_SystemStats_linux.cpp @@ -210,22 +210,22 @@ String SystemStats::getComputerName() String SystemStats::getUserLanguage() { - #if JUCE_BSD + #if JUCE_GLIBC + return getLocaleValue (_NL_ADDRESS_LANG_AB); + #else if (auto langEnv = getenv ("LANG")) return String::fromUTF8 (langEnv).upToLastOccurrenceOf (".UTF-8", false, true); return {}; - #else - return getLocaleValue (_NL_ADDRESS_LANG_AB); #endif } String SystemStats::getUserRegion() { - #if JUCE_BSD - return {}; - #else + #if JUCE_GLIBC return getLocaleValue (_NL_ADDRESS_COUNTRY_AB2); + #else + return {}; #endif } diff --git a/modules/juce_core/system/juce_SystemStats.cpp b/modules/juce_core/system/juce_SystemStats.cpp index 6dafa07185f..f44bb8f8a05 100644 --- a/modules/juce_core/system/juce_SystemStats.cpp +++ b/modules/juce_core/system/juce_SystemStats.cpp @@ -190,7 +190,7 @@ String SystemStats::getStackBacktrace() { String result; - #if JUCE_ANDROID || JUCE_WASM + #if JUCE_ANDROID || JUCE_MINGW || JUCE_WASM || JUCE_MUSL jassertfalse; // sorry, not implemented yet! #elif JUCE_WINDOWS diff --git a/modules/juce_core/system/juce_TargetPlatform.h b/modules/juce_core/system/juce_TargetPlatform.h index 0c55ad7c586..19941a8685e 100644 --- a/modules/juce_core/system/juce_TargetPlatform.h +++ b/modules/juce_core/system/juce_TargetPlatform.h @@ -45,6 +45,7 @@ - Either JUCE_LITTLE_ENDIAN or JUCE_BIG_ENDIAN. - Either JUCE_INTEL or JUCE_ARM - Either JUCE_GCC or JUCE_CLANG or JUCE_MSVC + - Either JUCE_GLIBC or JUCE_MUSL will be defined on Linux depending on the system's libc implementation. */ //============================================================================== @@ -212,6 +213,14 @@ #elif __MMX__ || __SSE__ || __amd64__ #define JUCE_INTEL 1 #endif + + #if JUCE_LINUX + #ifdef __GLIBC__ + #define JUCE_GLIBC 1 + #else + #define JUCE_MUSL 1 + #endif + #endif #endif //==============================================================================