diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index fbbbbe78e0..e8536cddf8 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -31,7 +31,7 @@ function(_juce_add_pips) CONFIGURE_DEPENDS LIST_DIRECTORIES false "${CMAKE_CURRENT_SOURCE_DIR}/*.h") - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + if((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD")) list(REMOVE_ITEM headers "${CMAKE_CURRENT_SOURCE_DIR}/CameraDemo.h" "${CMAKE_CURRENT_SOURCE_DIR}/PushNotificationsDemo.h" diff --git a/examples/DemoRunner/CMakeLists.txt b/examples/DemoRunner/CMakeLists.txt index 1fea3a8859..63101c5c14 100644 --- a/examples/DemoRunner/CMakeLists.txt +++ b/examples/DemoRunner/CMakeLists.txt @@ -55,7 +55,6 @@ target_compile_definitions(DemoRunner PRIVATE PIP_JUCE_EXAMPLES_DIRECTORY_STRING="${JUCE_SOURCE_DIR}/examples" JUCE_ALLOW_STATIC_NULL_VARIABLES=0 JUCE_DEMO_RUNNER=1 - JUCE_JACK=1 JUCE_STRICT_REFCOUNTEDPOINTER=1 JUCE_UNIT_TESTS=1 JUCE_USE_CAMERA=1 diff --git a/examples/DemoRunner/Source/Demos/DemoPIPs1.cpp b/examples/DemoRunner/Source/Demos/DemoPIPs1.cpp index ec6f561ccf..570f77b8d2 100644 --- a/examples/DemoRunner/Source/Demos/DemoPIPs1.cpp +++ b/examples/DemoRunner/Source/Demos/DemoPIPs1.cpp @@ -59,7 +59,7 @@ #include "../../../DSP/WaveShaperTanhDemo.h" #include "../../../Utilities/Box2DDemo.h" -#if JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX +#if JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD #include "../../../Utilities/ChildProcessDemo.h" #endif #include "../../../Utilities/CryptographyDemo.h" @@ -104,7 +104,7 @@ void registerDemos_One() noexcept REGISTER_DEMO (WaveShaperTanhDemo, DSP, false) REGISTER_DEMO (Box2DDemo, Utilities, false) - #if JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX + #if JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD REGISTER_DEMO (ChildProcessDemo, Utilities, false) #endif REGISTER_DEMO (CryptographyDemo, Utilities, false) diff --git a/examples/DemoRunner/Source/Demos/DemoPIPs2.cpp b/examples/DemoRunner/Source/Demos/DemoPIPs2.cpp index c468c74ae0..a1759e6558 100644 --- a/examples/DemoRunner/Source/Demos/DemoPIPs2.cpp +++ b/examples/DemoRunner/Source/Demos/DemoPIPs2.cpp @@ -33,7 +33,7 @@ #include "../../../GUI/AnimationAppDemo.h" #include "../../../GUI/AnimationDemo.h" #include "../../../GUI/BouncingBallWavetableDemo.h" -#if JUCE_USE_CAMERA && ! JUCE_LINUX +#if JUCE_USE_CAMERA && ! (JUCE_LINUX || JUCE_BSD) #include "../../../GUI/CameraDemo.h" #endif #if ! JUCE_ANDROID @@ -58,7 +58,7 @@ #include "../../../GUI/OpenGLDemo2D.h" #endif #include "../../../GUI/PropertiesDemo.h" -#if ! JUCE_LINUX +#if ! (JUCE_LINUX || JUCE_BSD) #include "../../../GUI/VideoDemo.h" #endif #include "../../../GUI/WebBrowserDemo.h" @@ -70,7 +70,7 @@ void registerDemos_Two() noexcept REGISTER_DEMO (AnimationAppDemo, GUI, false) REGISTER_DEMO (AnimationDemo, GUI, false) REGISTER_DEMO (BouncingBallWavetableDemo, GUI, false) - #if JUCE_USE_CAMERA && ! JUCE_LINUX + #if JUCE_USE_CAMERA && ! (JUCE_LINUX || JUCE_BSD) REGISTER_DEMO (CameraDemo, GUI, true) #endif #if ! JUCE_ANDROID @@ -95,7 +95,7 @@ void registerDemos_Two() noexcept REGISTER_DEMO (OpenGLDemo, GUI, true) #endif REGISTER_DEMO (PropertiesDemo, GUI, false) - #if ! JUCE_LINUX + #if ! (JUCE_LINUX || JUCE_BSD) REGISTER_DEMO (VideoDemo, GUI, true) #endif REGISTER_DEMO (WebBrowserDemo, GUI, true) diff --git a/examples/DemoRunner/Source/Main.cpp b/examples/DemoRunner/Source/Main.cpp index 65b71c98dc..59922b2b59 100644 --- a/examples/DemoRunner/Source/Main.cpp +++ b/examples/DemoRunner/Source/Main.cpp @@ -29,7 +29,7 @@ #include "UI/MainComponent.h" //============================================================================== -#if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC +#if JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD // Just add a simple icon to the Window system tray area or Mac menu bar.. struct DemoTaskbarComponent : public SystemTrayIconComponent, private Timer @@ -96,7 +96,7 @@ public: { registerAllDemos(); - #if JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX + #if JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD // (This function call is for one of the demos, which involves launching a child process) if (invokeChildProcessDemo (commandLine)) return; @@ -144,7 +144,7 @@ private: setContentOwned (new MainComponent(), false); setVisible (true); - #if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC + #if JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD taskbarIcon.reset (new DemoTaskbarComponent()); #endif } diff --git a/examples/GUI/VideoDemo.h b/examples/GUI/VideoDemo.h index 12dadc04d5..d2e807f87d 100644 --- a/examples/GUI/VideoDemo.h +++ b/examples/GUI/VideoDemo.h @@ -702,6 +702,6 @@ private: updatePositionSliderAndLabel(); } }; -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD #error "This demo is not supported on Linux!" #endif diff --git a/extras/Build/CMake/JUCECheckAtomic.cmake b/extras/Build/CMake/JUCECheckAtomic.cmake index bdbdbc0438..34795a6776 100644 --- a/extras/Build/CMake/JUCECheckAtomic.cmake +++ b/extras/Build/CMake/JUCECheckAtomic.cmake @@ -25,7 +25,7 @@ function(_juce_create_atomic_target target_name) add_library("${target_name}" INTERFACE) add_library("juce::${target_name}" ALIAS "${target_name}") - if(NOT (CMAKE_SYSTEM_NAME STREQUAL "Linux")) + if(NOT ((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD"))) return() endif() diff --git a/extras/Build/CMake/JUCEUtils.cmake b/extras/Build/CMake/JUCEUtils.cmake index 043b31636d..d3046444e3 100644 --- a/extras/Build/CMake/JUCEUtils.cmake +++ b/extras/Build/CMake/JUCEUtils.cmake @@ -137,7 +137,7 @@ function(_juce_find_linux_target_architecture result) set("${result}" "${match_result}" PARENT_SCOPE) endfunction() -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") +if((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD")) _juce_create_pkgconfig_target(JUCE_CURL_LINUX_DEPS libcurl) _juce_create_pkgconfig_target(JUCE_BROWSER_LINUX_DEPS webkit2gtk-4.0 gtk+-x11-3.0) @@ -177,7 +177,7 @@ function(_juce_set_default_properties) set_property(GLOBAL PROPERTY JUCE_VST3_COPY_DIR "${prefix}/VST3") set_property(GLOBAL PROPERTY JUCE_AAX_COPY_DIR "${prefix}/Avid/Audio/Plug-Ins") - elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + elseif((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD")) set_property(GLOBAL PROPERTY JUCE_VST_COPY_DIR "$ENV{HOME}/.vst") set_property(GLOBAL PROPERTY JUCE_VST3_COPY_DIR "$ENV{HOME}/.vst3") endif() @@ -553,7 +553,9 @@ function(juce_add_module module_path) target_link_libraries(juce_core INTERFACE juce::juce_atomic_wrapper) - if(CMAKE_SYSTEM_NAME STREQUAL "Android") + if(CMAKE_SYSTEM_NAME MATCHES ".*BSD") + target_link_libraries(juce_core INTERFACE execinfo) + elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") target_sources(juce_core INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c") target_include_directories(juce_core INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures") target_link_libraries(juce_core INTERFACE android log) @@ -575,7 +577,7 @@ function(juce_add_module module_path) target_compile_definitions(${module_name} INTERFACE JUCE_MODULE_AVAILABLE_${module_name}=1) - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + if((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD")) target_compile_definitions(${module_name} INTERFACE LINUX=1) endif() @@ -613,7 +615,7 @@ function(juce_add_module module_path) endforeach() _juce_link_libs_from_metadata("${module_name}" "${metadata_dict}" iOSLibs) - elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + elseif((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD")) _juce_get_metadata("${metadata_dict}" linuxPackages module_linuxpackages) if(module_linuxpackages) @@ -681,7 +683,7 @@ endfunction() # know they need it. Otherwise, we won't link anything. # See the NEEDS_CURL, NEEDS_WEB_BROWSER, and NEEDS_STORE_KIT options in the CMake/readme.md. function(_juce_link_optional_libraries target) - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + if((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD")) get_target_property(needs_curl ${target} JUCE_NEEDS_CURL) if(needs_curl) @@ -1346,7 +1348,7 @@ function(_juce_set_plugin_target_properties shared_code_target kind) set(output_path "${products_folder}/${product_name}.vst3") - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + if((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD")) set_target_properties(${target_name} PROPERTIES SUFFIX .so LIBRARY_OUTPUT_DIRECTORY "${output_path}/Contents/${JUCE_LINUX_TARGET_ARCHITECTURE}-linux") @@ -1479,7 +1481,7 @@ function(_juce_link_plugin_wrapper shared_code_target kind) add_library(${target_name} MODULE) endif() - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + if((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD")) target_link_libraries(${target_name} PRIVATE "-Wl,--no-undefined") endif() diff --git a/extras/NetworkGraphicsDemo/Source/SlaveComponent.h b/extras/NetworkGraphicsDemo/Source/SlaveComponent.h index 4d185215e5..b62f37c987 100644 --- a/extras/NetworkGraphicsDemo/Source/SlaveComponent.h +++ b/extras/NetworkGraphicsDemo/Source/SlaveComponent.h @@ -141,6 +141,8 @@ private: return "Windows"; #elif JUCE_LINUX return "Linux"; + #elif JUCE_BSD + return "BSD"; #endif } diff --git a/extras/Projucer/Source/Application/jucer_Application.cpp b/extras/Projucer/Source/Application/jucer_Application.cpp index adb518bbf1..c441a911e2 100644 --- a/extras/Projucer/Source/Application/jucer_Application.cpp +++ b/extras/Projucer/Source/Application/jucer_Application.cpp @@ -111,7 +111,7 @@ bool ProjucerApplication::initialiseLogger (const char* filePrefix) { if (logger == nullptr) { - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD String folder = "~/.config/Projucer/Logs"; #else String folder = "com.juce.projucer"; @@ -717,7 +717,7 @@ static String getPlatformSpecificFileExtension() return ".app"; #elif JUCE_WINDOWS return ".exe"; - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD return {}; #else jassertfalse; @@ -738,7 +738,7 @@ static File getPlatformSpecificProjectFolder() return buildsFolder.getChildFile ("MacOSX"); #elif JUCE_WINDOWS return buildsFolder.getChildFile ("VisualStudio2017"); - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD return buildsFolder.getChildFile ("LinuxMakefile"); #else jassertfalse; @@ -775,8 +775,8 @@ static File tryToFindDemoRunnerExecutableInBuilds() if (demoRunnerExecutable.existsAsFile()) return demoRunnerExecutable; - #elif JUCE_LINUX - projectFolder = projectFolder.getChildFile ("LinuxMakefile").getChildFile ("build"); + #elif JUCE_LINUX || JUCE_BSD + projectFolder = projectFolder.getChildFile ("build"); auto demoRunnerExecutable = projectFolder.getChildFile ("DemoRunner"); if (demoRunnerExecutable.existsAsFile()) @@ -854,7 +854,7 @@ File ProjucerApplication::tryToFindDemoRunnerProject() auto demoRunnerProjectFile = projectFolder.getChildFile ("DemoRunner.xcodeproj"); #elif JUCE_WINDOWS auto demoRunnerProjectFile = projectFolder.getChildFile ("DemoRunner.sln"); - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD auto demoRunnerProjectFile = projectFolder.getChildFile ("Makefile"); #endif @@ -883,33 +883,33 @@ void ProjucerApplication::launchDemoRunner() { auto& lf = Desktop::getInstance().getDefaultLookAndFeel(); + #if JUCE_LINUX || JUCE_BSD demoRunnerAlert.reset (lf.createAlertWindow ("Open Project", "Couldn't find a compiled version of the Demo Runner." - #if JUCE_LINUX - " Do you want to build it now?", "Build project", "Cancel", - #else - " Do you want to open the project?", "Open project", "Cancel", - #endif - {}, - AlertWindow::QuestionIcon, 2, + " Please compile the Demo Runner project in the JUCE examples directory.", + "OK", {}, {}, + AlertWindow::WarningIcon, 1, mainWindowList.getFrontmostWindow (false))); + demoRunnerAlert->enterModalState (true, ModalCallbackFunction::create ([this] (int) + { + demoRunnerAlert.reset (nullptr); + }), false); + #else + demoRunnerAlert.reset (lf.createAlertWindow ("Open Project", + "Couldn't find a compiled version of the Demo Runner." + " Do you want to open the project?", + "Open project", "Cancel", {}, + AlertWindow::QuestionIcon, 2, + mainWindowList.getFrontmostWindow (false))); demoRunnerAlert->enterModalState (true, ModalCallbackFunction::create ([this, demoRunnerFile] (int retVal) { demoRunnerAlert.reset (nullptr); if (retVal == 1) - { - #if JUCE_LINUX - String command ("make -C " + demoRunnerFile.getParentDirectory().getFullPathName() + " CONFIG=Release -j3"); - - if (! makeProcess.start (command)) - AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon, "Error", "Error building Demo Runner."); - #else demoRunnerFile.startAsProcess(); - #endif - } }), false); + #endif } } @@ -998,18 +998,8 @@ void ProjucerApplication::getCommandInfo (CommandID commandID, ApplicationComman break; case CommandIDs::launchDemoRunner: - #if JUCE_LINUX - if (makeProcess.isRunning()) - { - result.setInfo ("Building Demo Runner...", "The Demo Runner project is currently building", CommandCategories::general, 0); - result.setActive (false); - } - else - #endif - { - result.setInfo ("Launch Demo Runner", "Launches the JUCE demo runner application, or the project if it can't be found", CommandCategories::general, 0); - result.setActive (tryToFindDemoRunnerExecutable() != File() || tryToFindDemoRunnerProject() != File()); - } + result.setInfo ("Launch Demo Runner", "Launches the JUCE demo runner application, or the project if it can't be found", CommandCategories::general, 0); + result.setActive (tryToFindDemoRunnerExecutable() != File() || tryToFindDemoRunnerProject() != File()); break; case CommandIDs::open: @@ -1426,7 +1416,7 @@ PropertiesFile::Options ProjucerApplication::getPropertyFileOptionsFor (const St options.applicationName = filename; options.filenameSuffix = "settings"; options.osxLibrarySubFolder = "Application Support"; - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD options.folderName = "~/.config/Projucer"; #else options.folderName = "Projucer"; diff --git a/extras/Projucer/Source/Application/jucer_Application.h b/extras/Projucer/Source/Application/jucer_Application.h index 038b4ac071..2bdc86539b 100644 --- a/extras/Projucer/Source/Application/jucer_Application.h +++ b/extras/Projucer/Source/Application/jucer_Application.h @@ -220,9 +220,6 @@ private: std::unique_ptr demoRunnerAlert; bool hasScannedForDemoRunnerExecutable = false, hasScannedForDemoRunnerProject = false; File lastJUCEPath, lastDemoRunnerExectuableFile, lastDemoRunnerProjectFile; - #if JUCE_LINUX - ChildProcess makeProcess; - #endif int selectedColourSchemeIndex = 0, selectedEditorColourSchemeIndex = 0; diff --git a/extras/Projucer/Source/Application/jucer_AutoUpdater.cpp b/extras/Projucer/Source/Application/jucer_AutoUpdater.cpp index c63c28c596..7a14e38288 100644 --- a/extras/Projucer/Source/Application/jucer_AutoUpdater.cpp +++ b/extras/Projucer/Source/Application/jucer_AutoUpdater.cpp @@ -82,6 +82,8 @@ void LatestVersionCheckerAndUpdater::run() return "windows"; #elif JUCE_LINUX return "linux"; + #elif JUCE_BSD + return "bsd"; #else jassertfalse; return "Unknown"; @@ -444,7 +446,7 @@ private: if (threadShouldExit()) return Result::fail ("Cancelled"); - #if JUCE_LINUX || JUCE_MAC + #if JUCE_LINUX || JUCE_BSD || JUCE_MAC r = setFilePermissions (unzipTarget.folder, zip); if (r.failed()) @@ -502,10 +504,10 @@ private: static void restartProcess (const File& targetFolder) { - #if JUCE_MAC || JUCE_LINUX + #if JUCE_MAC || JUCE_LINUX || JUCE_BSD #if JUCE_MAC auto newProcess = targetFolder.getChildFile ("Projucer.app").getChildFile ("Contents").getChildFile ("MacOS").getChildFile ("Projucer"); - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD auto newProcess = targetFolder.getChildFile ("Projucer"); #endif diff --git a/extras/Projucer/Source/Application/jucer_CommonHeaders.h b/extras/Projucer/Source/Application/jucer_CommonHeaders.h index fac5ce5313..7c0ab468c9 100644 --- a/extras/Projucer/Source/Application/jucer_CommonHeaders.h +++ b/extras/Projucer/Source/Application/jucer_CommonHeaders.h @@ -48,7 +48,7 @@ struct TargetOS return windows; #elif JUCE_MAC return osx; - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD return linux; #else return unknown; diff --git a/extras/Projucer/Source/Licenses/jucer_LicenseController.cpp b/extras/Projucer/Source/Licenses/jucer_LicenseController.cpp index 2a7d97cbff..7a79dad72a 100644 --- a/extras/Projucer/Source/Licenses/jucer_LicenseController.cpp +++ b/extras/Projucer/Source/Licenses/jucer_LicenseController.cpp @@ -143,7 +143,7 @@ void LicenseController::logout() thread.reset(); updateState ({}); - #if ! JUCE_LINUX + #if ! (JUCE_LINUX || JUCE_BSD) WebBrowserComponent::clearCookies(); #endif @@ -187,7 +187,7 @@ void LicenseController::ensureLicenseWebviewIsOpenWithPage (const String& param) } else { - #if ! JUCE_LINUX + #if ! (JUCE_LINUX || JUCE_BSD) WebBrowserComponent::clearCookies(); #endif diff --git a/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineDLL.h b/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineDLL.h index 347880c9cf..cdcd8d0877 100644 --- a/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineDLL.h +++ b/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineDLL.h @@ -96,7 +96,7 @@ struct CompileEngineDLL : private DeletedAtShutdown { #if JUCE_MAC return "JUCECompileEngine.dylib"; - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD return "JUCECompileEngine.so"; #elif JUCE_WINDOWS return "JUCECompileEngine.dll"; diff --git a/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineServer.cpp b/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineServer.cpp index 20ed871d08..15d6c86636 100644 --- a/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineServer.cpp +++ b/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineServer.cpp @@ -35,7 +35,7 @@ #include "jucer_ProjectBuildInfo.h" #include "jucer_ClientServerMessages.h" -#if JUCE_LINUX +#if JUCE_LINUX || JUCE_BSD #include #include #endif diff --git a/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineSettings.h b/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineSettings.h index 9619ccf064..7a99ce002b 100644 --- a/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineSettings.h +++ b/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineSettings.h @@ -95,7 +95,7 @@ private: return "OSX"; #elif JUCE_WINDOWS return "WINDOWS"; - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD return "LINUX"; #else // unknown platform?! diff --git a/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp b/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp index a19007969e..77446d1de3 100644 --- a/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp +++ b/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp @@ -1369,9 +1369,9 @@ void ProjectContentComponent::handleMissingSystemHeaders() #elif JUCE_WINDOWS String tabMessage ("Compiler not available due to missing system headers\nPlease install a recent version of Visual Studio and the Windows Desktop SDK"); String alertWindowMessage ("Missing system headers\nPlease install a recent version of Visual Studio and the Windows Desktop SDK"); - #elif JUCE_LINUX - String tabMessage ("Compiler not available due to missing system headers\nPlease do a sudo apt-get install ..."); - String alertWindowMessage ("Missing system headers\nPlease do sudo apt-get install ..."); + #elif JUCE_LINUX || JUCE_BSD + String tabMessage ("Compiler not available due to missing system headers\nPlease insall using your package manager"); + String alertWindowMessage ("Missing system headers\nPlease insall using your package manager"); #endif setBuildEnabled (false, true); diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h index 54c0c0e030..de24fcc0c1 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h @@ -112,7 +112,7 @@ public: static Identifier exporterName (XcodeProjectExporter::getValueTreeTypeNameMac()); #elif JUCE_WINDOWS static Identifier exporterName (CodeBlocksProjectExporter::getValueTreeTypeNameWindows()); - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD static Identifier exporterName (MakefileProjectExporter::getValueTreeTypeName()); #else static Identifier exporterName; diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp index 669f19d191..25d785f0fd 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp @@ -131,7 +131,7 @@ ProjectExporter::ExporterTypeInfo ProjectExporter::getCurrentPlatformExporterTyp return ProjectExporter::getTypeInfoForExporter (XcodeProjectExporter::getValueTreeTypeNameMac()); #elif JUCE_WINDOWS return ProjectExporter::getTypeInfoForExporter (MSVCProjectExporterVC2019::getValueTreeTypeName()); - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD return ProjectExporter::getTypeInfoForExporter (MakefileProjectExporter::getValueTreeTypeName()); #else #error "unknown platform!" diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h index da225fc496..508ed7cd1b 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h @@ -119,6 +119,8 @@ public: return isWindows() || isAndroid(); #elif JUCE_LINUX return isLinux() || isAndroid(); + #elif JUCE_BSD + return isLinux(); #else #error #endif diff --git a/modules/juce_audio_basics/utilities/juce_SmoothedValue.h b/modules/juce_audio_basics/utilities/juce_SmoothedValue.h index 7bcd5a1803..36682c6842 100644 --- a/modules/juce_audio_basics/utilities/juce_SmoothedValue.h +++ b/modules/juce_audio_basics/utilities/juce_SmoothedValue.h @@ -510,7 +510,7 @@ public: expect (referenceData.getSample (0, 10) < sv.getTargetValue()); expectWithinAbsoluteError (referenceData.getSample (0, 11), sv.getTargetValue(), - 1.0e-7f); + 2.0e-7f); auto getUnitData = [] (int numSamplesToGenerate) { @@ -528,7 +528,7 @@ public: for (int i = 0; i < test.getNumSamples(); ++i) expectWithinAbsoluteError (test.getSample (0, i), reference.getSample (0, i), - 1.0e-7f); + 2.0e-7f); }; auto testData = getUnitData (numSamples); diff --git a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp index f591f48127..2c08b112cf 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp +++ b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp @@ -88,13 +88,13 @@ void AudioIODeviceType::callDeviceChangeListeners() AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ASIO() { return nullptr; } #endif -#if JUCE_LINUX && JUCE_ALSA +#if (JUCE_LINUX || JUCE_BSD) && JUCE_ALSA AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ALSA() { return createAudioIODeviceType_ALSA_PCMDevices(); } #else AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ALSA() { return nullptr; } #endif -#if JUCE_LINUX && JUCE_JACK +#if (JUCE_LINUX || JUCE_BSD) && JUCE_JACK AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_JACK() { return new JackAudioIODeviceType(); } #else AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_JACK() { return nullptr; } diff --git a/modules/juce_audio_devices/juce_audio_devices.cpp b/modules/juce_audio_devices/juce_audio_devices.cpp index 7f7e461dbe..0423c7c7d8 100644 --- a/modules/juce_audio_devices/juce_audio_devices.cpp +++ b/modules/juce_audio_devices/juce_audio_devices.cpp @@ -162,7 +162,7 @@ namespace ump = universal_midi_packets; #endif //============================================================================== -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD #if JUCE_ALSA /* Got an include error here? If so, you've either not got ALSA installed, or you've not got your paths set up correctly to find its header files. @@ -189,7 +189,7 @@ namespace ump = universal_midi_packets; #include "native/juce_linux_JackAudio.cpp" #endif - #if JUCE_BELA + #if (JUCE_LINUX && JUCE_BELA) /* Got an include error here? If so, you've either not got the bela headers installed, or you've not got your paths set up correctly to find its header files. diff --git a/modules/juce_audio_devices/midi_io/juce_MidiDevices.h b/modules/juce_audio_devices/midi_io/juce_MidiDevices.h index 982e71c654..3a5f48bc80 100644 --- a/modules/juce_audio_devices/midi_io/juce_MidiDevices.h +++ b/modules/juce_audio_devices/midi_io/juce_MidiDevices.h @@ -108,7 +108,7 @@ public: */ static std::unique_ptr openDevice (const String& deviceIdentifier, MidiInputCallback* callback); - #if JUCE_LINUX || JUCE_MAC || JUCE_IOS || DOXYGEN + #if JUCE_LINUX || JUCE_BSD || JUCE_MAC || JUCE_IOS || DOXYGEN /** This will try to create a new midi input device (only available on Linux, macOS and iOS). This will attempt to create a new midi input device with the specified name for other @@ -268,7 +268,7 @@ public: */ static std::unique_ptr openDevice (const String& deviceIdentifier); - #if JUCE_LINUX || JUCE_MAC || JUCE_IOS || DOXYGEN + #if JUCE_LINUX || JUCE_BSD || JUCE_MAC || JUCE_IOS || DOXYGEN /** This will try to create a new midi output device (only available on Linux, macOS and iOS). This will attempt to create a new midi output device with the specified name that other diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterApp.cpp b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterApp.cpp index 48d5104cb0..cb099283a2 100644 --- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterApp.cpp +++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterApp.cpp @@ -58,7 +58,7 @@ public: options.applicationName = getApplicationName(); options.filenameSuffix = ".settings"; options.osxLibrarySubFolder = "Application Support"; - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD options.folderName = "~/.config"; #else options.folderName = ""; diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp index f0f915fa2d..4d69526737 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -188,7 +188,7 @@ namespace } //============================================================================== -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD struct SharedMessageThread : public Thread { @@ -364,7 +364,7 @@ public: JUCE_AUTORELEASEPOOL { { - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD MessageManagerLock mmLock; #endif stopTimer(); @@ -385,7 +385,7 @@ public: if (activePlugins.size() == 0) { - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD SharedMessageThread::deleteInstance(); #endif shutdownJuce_GUI(); @@ -1066,11 +1066,11 @@ public: { setVisible (false); - #if JUCE_WINDOWS || JUCE_LINUX + #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD addToDesktop (0, args.ptr); hostWindow = (HostWindowType) args.ptr; - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD X11Symbols::getInstance()->xReparentWindow (display, (Window) getWindowHandle(), (HostWindowType) hostWindow, @@ -1174,7 +1174,7 @@ public: { const ScopedValueSetter resizingParentSetter (resizingParent, true); - #if JUCE_LINUX // setSize() on linux causes renoise and energyxt to fail. + #if JUCE_LINUX || JUCE_BSD // setSize() on linux causes renoise and energyxt to fail. auto rect = convertToHostBounds ({ 0, 0, (int16) editorBounds.getHeight(), (int16) editorBounds.getWidth() }); X11Symbols::getInstance()->xResizeWindow (display, (Window) getWindowHandle(), @@ -1219,7 +1219,7 @@ public: #if JUCE_MAC setNativeHostWindowSizeVST (hostWindow, this, newWidth, newHeight, wrapper.useNSView); - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD // (Currently, all linux hosts support sizeWindow, so this should never need to happen) setSize (newWidth, newHeight); #else @@ -1355,7 +1355,7 @@ public: float editorScaleFactor = 1.0f; juce::Rectangle lastBounds; - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD using HostWindowType = ::Window; ::Display* display = XWindowSystem::getInstance()->getDisplay(); #elif JUCE_WINDOWS @@ -2142,7 +2142,7 @@ namespace { if (audioMaster (nullptr, Vst2::audioMasterVersion, 0, 0, nullptr, 0) != 0) { - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD MessageManagerLock mmLock; #endif @@ -2197,7 +2197,7 @@ namespace //============================================================================== // Linux startup code.. -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD JUCE_EXPORTED_FUNCTION Vst2::AEffect* VSTPluginMain (Vst2::audioMasterCallback audioMaster); JUCE_EXPORTED_FUNCTION Vst2::AEffect* VSTPluginMain (Vst2::audioMasterCallback audioMaster) diff --git a/modules/juce_audio_plugin_client/utility/juce_IncludeSystemHeaders.h b/modules/juce_audio_plugin_client/utility/juce_IncludeSystemHeaders.h index b82650fad4..dbc57db45e 100644 --- a/modules/juce_audio_plugin_client/utility/juce_IncludeSystemHeaders.h +++ b/modules/juce_audio_plugin_client/utility/juce_IncludeSystemHeaders.h @@ -36,7 +36,7 @@ #ifdef __INTEL_COMPILER #pragma warning (disable : 1899) #endif -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD #include #include #include diff --git a/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp b/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp index 831935ec1e..2c60956be6 100644 --- a/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp +++ b/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp @@ -42,7 +42,7 @@ namespace juce #define JUCE_VST3_CAN_REPLACE_VST2 1 #endif -#if JucePlugin_Build_VST3 && JUCE_VST3_CAN_REPLACE_VST2 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) +#if JucePlugin_Build_VST3 && JUCE_VST3_CAN_REPLACE_VST2 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD) #define VST3_REPLACEMENT_AVAILABLE 1 // NB: Nasty old-fashioned code in here because it's copied from the Steinberg example code. diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp index 20e7a50800..809280745a 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp @@ -38,7 +38,7 @@ void AudioPluginFormatManager::addDefaultFormats() { ignoreUnused (format); - #if JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_IOS) + #if JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD || JUCE_IOS) jassert (dynamic_cast (format) == nullptr); #endif @@ -50,7 +50,7 @@ void AudioPluginFormatManager::addDefaultFormats() jassert (dynamic_cast (format) == nullptr); #endif - #if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX + #if JUCE_PLUGINHOST_LADSPA && (JUCE_LINUX || JUCE_BSD) jassert (dynamic_cast (format) == nullptr); #endif } @@ -60,7 +60,7 @@ void AudioPluginFormatManager::addDefaultFormats() formats.add (new AudioUnitPluginFormat()); #endif - #if JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_IOS) + #if JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD || JUCE_IOS) formats.add (new VSTPluginFormat()); #endif @@ -68,7 +68,7 @@ void AudioPluginFormatManager::addDefaultFormats() formats.add (new VST3PluginFormat()); #endif - #if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX + #if JUCE_PLUGINHOST_LADSPA && (JUCE_LINUX || JUCE_BSD) formats.add (new LADSPAPluginFormat()); #endif } diff --git a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp index 176150e612..dd95cafbcb 100644 --- a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp @@ -23,7 +23,7 @@ ============================================================================== */ -#if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX +#if JUCE_PLUGINHOST_LADSPA && (JUCE_LINUX || JUCE_BSD) #include diff --git a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h index d7f39967c6..52b0e7dcd6 100644 --- a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h @@ -26,7 +26,7 @@ namespace juce { -#if (JUCE_PLUGINHOST_LADSPA && JUCE_LINUX) || DOXYGEN +#if (JUCE_PLUGINHOST_LADSPA && (JUCE_LINUX || JUCE_BSD)) || DOXYGEN //============================================================================== /** diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index f3362872fc..42871e9746 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -173,7 +173,7 @@ namespace { #if JUCE_WINDOWS return timeGetTime() * 1000000.0; - #elif JUCE_LINUX || JUCE_IOS || JUCE_ANDROID + #elif JUCE_LINUX || JUCE_BSD || JUCE_IOS || JUCE_ANDROID timeval micro; gettimeofday (µ, nullptr); return (double) micro.tv_usec * 1000.0; @@ -230,7 +230,7 @@ static pointer_sized_int VSTCALLBACK audioMaster (Vst2::AEffect*, int32, int32, #endif //============================================================================== -#if JUCE_LINUX +#if JUCE_LINUX || JUCE_BSD namespace { @@ -624,7 +624,7 @@ struct ModuleHandle : public ReferenceCountedObject { getActiveModules().add (this); - #if JUCE_WINDOWS || JUCE_LINUX || JUCE_IOS || JUCE_ANDROID + #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD || JUCE_IOS || JUCE_ANDROID fullParentDirectoryPathName = f.getParentDirectory().getFullPathName(); #elif JUCE_MAC FSRef ref; @@ -644,7 +644,7 @@ struct ModuleHandle : public ReferenceCountedObject String fullParentDirectoryPathName; #endif - #if JUCE_WINDOWS || JUCE_LINUX || JUCE_ANDROID + #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD || JUCE_ANDROID DynamicLibrary module; bool open() @@ -2108,7 +2108,7 @@ private: { if (auto* ed = getActiveEditor()) { - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD const MessageManagerLock mmLock; #endif @@ -2742,7 +2742,7 @@ public: #endif plugin (plug) { - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD pluginWindow = None; ignoreUnused (pluginRefusesToResize, alreadyInside); #elif JUCE_MAC @@ -2827,7 +2827,7 @@ public: { if (isOpen) { - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD if (pluginWindow != 0) { auto clip = g.getClipBounds(); @@ -2861,7 +2861,7 @@ public: ScopedThreadDPIAwarenessSetter threadDpiAwarenessSetter { pluginHWND }; MoveWindow (pluginHWND, pos.getX(), pos.getY(), pos.getWidth(), pos.getHeight(), TRUE); } - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD if (pluginWindow != 0) { X11Symbols::getInstance()->xMoveResizeWindow (display, pluginWindow, @@ -2888,7 +2888,7 @@ public: if (auto* peer = getTopLevelComponent()->getPeer()) setScaleFactorAndDispatchMessage (peer->getPlatformScaleFactor()); - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD SafePointer safeThis (this); MessageManager::callAsync ([this, safeThis] @@ -2963,7 +2963,7 @@ public: reentrantGuard = false; } - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD if (pluginWindow == 0) { updatePluginWindowHandle(); @@ -2980,7 +2980,7 @@ public: { ignoreUnused (e); - #if JUCE_WINDOWS || JUCE_LINUX + #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD toFront (true); #endif } @@ -3138,7 +3138,7 @@ private: } } } - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD updatePluginWindowHandle(); int w = 250, h = 150; @@ -3206,7 +3206,7 @@ private: originalWndProc = 0; pluginHWND = 0; - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD pluginWindow = 0; #endif } @@ -3287,7 +3287,7 @@ private: } #endif - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD void updatePluginWindowHandle() { pluginWindow = getChildWindow ((Window) getWindowHandle()); @@ -3402,7 +3402,7 @@ private: HWND pluginHWND = {}; void* originalWndProc = {}; int sizeCheckCount = 0; - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD ::Display* display = XWindowSystem::getInstance()->getDisplay(); Window pluginWindow = 0; #endif @@ -3562,7 +3562,7 @@ bool VSTPluginFormat::fileMightContainThisPluginType (const String& fileOrIdenti return f.isDirectory() && f.hasFileExtension (".vst"); #elif JUCE_WINDOWS return f.existsAsFile() && f.hasFileExtension (".dll"); - #elif JUCE_LINUX || JUCE_ANDROID + #elif JUCE_LINUX || JUCE_BSD || JUCE_ANDROID return f.existsAsFile() && f.hasFileExtension (".so"); #endif } @@ -3616,7 +3616,7 @@ FileSearchPath VSTPluginFormat::getDefaultLocationsToSearch() { #if JUCE_MAC return FileSearchPath ("~/Library/Audio/Plug-Ins/VST;/Library/Audio/Plug-Ins/VST"); - #elif JUCE_LINUX || JUCE_ANDROID + #elif JUCE_LINUX || JUCE_BSD || JUCE_ANDROID return FileSearchPath (SystemStats::getEnvironmentVariable ("VST_PATH", "/usr/lib/vst;/usr/local/lib/vst;~/.vst") .replace (":", ";")); diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp index 45f8eeb427..8a80cc7c43 100644 --- a/modules/juce_audio_processors/juce_audio_processors.cpp +++ b/modules/juce_audio_processors/juce_audio_processors.cpp @@ -48,7 +48,7 @@ #endif #endif -#if (JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_VST3) && JUCE_LINUX +#if (JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_VST3) && (JUCE_LINUX || JUCE_BSD) #include #include #include @@ -68,7 +68,7 @@ namespace juce { -#if JUCE_PLUGINHOST_VST || (JUCE_PLUGINHOST_LADSPA && JUCE_LINUX) +#if JUCE_PLUGINHOST_VST || (JUCE_PLUGINHOST_LADSPA && JUCE_LINUX || JUCE_BSD) static bool arrayContainsPlugin (const OwnedArray& list, const PluginDescription& desc) diff --git a/modules/juce_audio_processors/utilities/juce_PluginHostType.cpp b/modules/juce_audio_processors/utilities/juce_PluginHostType.cpp index c7092044a5..d7171bdaaf 100644 --- a/modules/juce_audio_processors/utilities/juce_PluginHostType.cpp +++ b/modules/juce_audio_processors/utilities/juce_PluginHostType.cpp @@ -290,7 +290,7 @@ PluginHostType::HostType PluginHostType::getHostType() if (hostFilename.containsIgnoreCase ("AudioPluginHost")) return JUCEPluginHost; if (hostFilename.containsIgnoreCase ("Vienna Ensemble Pro")) return ViennaEnsemblePro; - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD if (hostFilename.containsIgnoreCase ("Ardour")) return Ardour; if (hostFilename.startsWithIgnoreCase ("Waveform")) return TracktionWaveform; if (hostFilename.containsIgnoreCase ("Tracktion")) return TracktionGeneric; diff --git a/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.h b/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.h index 4b776d36ef..8d7d30e829 100644 --- a/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.h +++ b/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.h @@ -166,7 +166,7 @@ private: AudioCDReader (void* handle); int getIndexAt (int samplePos); - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD AudioCDReader(); #endif diff --git a/modules/juce_audio_utils/juce_audio_utils.cpp b/modules/juce_audio_utils/juce_audio_utils.cpp index ce873805f9..5a9e66f566 100644 --- a/modules/juce_audio_utils/juce_audio_utils.cpp +++ b/modules/juce_audio_utils/juce_audio_utils.cpp @@ -81,7 +81,7 @@ #elif JUCE_ANDROID #include "native/juce_android_BluetoothMidiDevicePairingDialogue.cpp" -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD #if JUCE_USE_CDREADER #include "native/juce_linux_AudioCDReader.cpp" #endif diff --git a/modules/juce_core/files/juce_File.cpp b/modules/juce_core/files/juce_File.cpp index 79d9d8e553..19fb9b934a 100644 --- a/modules/juce_core/files/juce_File.cpp +++ b/modules/juce_core/files/juce_File.cpp @@ -231,7 +231,7 @@ String File::addTrailingSeparator (const String& path) } //============================================================================== -#if JUCE_LINUX +#if JUCE_LINUX || JUCE_BSD #define NAMES_ARE_CASE_SENSITIVE 1 #endif @@ -1061,7 +1061,25 @@ public: expect (! home.isOnCDRomDrive()); expect (File::getCurrentWorkingDirectory().exists()); expect (home.setAsCurrentWorkingDirectory()); - expect (File::getCurrentWorkingDirectory() == home); + + { + auto homeParent = home; + bool noSymlinks = true; + + while (! homeParent.isRoot()) + { + if (homeParent.isSymbolicLink()) + { + noSymlinks = false; + break; + } + + homeParent = homeParent.getParentDirectory(); + } + + if (noSymlinks) + expect (File::getCurrentWorkingDirectory() == home); + } { Array roots; diff --git a/modules/juce_core/juce_core.cpp b/modules/juce_core/juce_core.cpp index 84ded5f5f6..5ffbd6b443 100644 --- a/modules/juce_core/juce_core.cpp +++ b/modules/juce_core/juce_core.cpp @@ -64,7 +64,7 @@ #endif #else - #if JUCE_LINUX || JUCE_ANDROID + #if JUCE_LINUX || JUCE_BSD || JUCE_ANDROID #include #include #include @@ -82,7 +82,7 @@ #include #endif - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD #include #include #include @@ -206,6 +206,7 @@ #include "native/juce_mac_Files.mm" #include "native/juce_mac_Network.mm" #include "native/juce_mac_Strings.mm" + #include "native/juce_intel_SharedCode.h" #include "native/juce_mac_SystemStats.mm" #include "native/juce_mac_Threads.mm" @@ -218,13 +219,16 @@ #include "native/juce_win32_Threads.cpp" //============================================================================== -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD #include "native/juce_linux_CommonFile.cpp" #include "native/juce_linux_Files.cpp" #include "native/juce_linux_Network.cpp" #if JUCE_USE_CURL #include "native/juce_curl_Network.cpp" #endif + #if JUCE_BSD + #include "native/juce_intel_SharedCode.h" + #endif #include "native/juce_linux_SystemStats.cpp" #include "native/juce_linux_Threads.cpp" diff --git a/modules/juce_core/native/juce_BasicNativeHeaders.h b/modules/juce_core/native/juce_BasicNativeHeaders.h index 217951bf05..06d81d5141 100644 --- a/modules/juce_core/native/juce_BasicNativeHeaders.h +++ b/modules/juce_core/native/juce_BasicNativeHeaders.h @@ -258,7 +258,10 @@ #include #include #include + #include + #include #include + #include #include #include #include @@ -273,8 +276,10 @@ #include #include #include + #include #include #include + #include #include #include #include diff --git a/modules/juce_core/native/juce_intel_SharedCode.h b/modules/juce_core/native/juce_intel_SharedCode.h new file mode 100644 index 0000000000..b59515d8a6 --- /dev/null +++ b/modules/juce_core/native/juce_intel_SharedCode.h @@ -0,0 +1,108 @@ +/* + ============================================================================== + + This file is part of the JUCE library. + Copyright (c) 2020 - Raw Material Software Limited + + JUCE is an open source library subject to commercial or open-source + licensing. + + The code included in this file is provided under the terms of the ISC license + http://www.isc.org/downloads/software-support-policy/isc-license. Permission + To use, copy, modify, and/or distribute this software for any purpose with or + without fee is hereby granted provided that the above copyright notice and + this permission notice appear in all copies. + + JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + ============================================================================== +*/ + +namespace juce +{ + +#if JUCE_INTEL && ! JUCE_NO_INLINE_ASM + +namespace SystemStatsHelpers +{ + +static void doCPUID (uint32& a, uint32& b, uint32& c, uint32& d, uint32 type) +{ + uint32 la = a, lb = b, lc = c, ld = d; + + #if JUCE_32BIT && defined (__pic__) + asm ("mov %%ebx, %%edi\n" + "cpuid\n" + "xchg %%edi, %%ebx\n" + : "=a" (la), "=D" (lb), "=c" (lc), "=d" (ld) + : "a" (type), "c" (0)); + #else + asm ("cpuid\n" + : "=a" (la), "=b" (lb), "=c" (lc), "=d" (ld) + : "a" (type), "c" (0)); + #endif + + a = la; b = lb; c = lc; d = ld; +} + +static void getCPUInfo (bool& hasMMX, + bool& hasSSE, + bool& hasSSE2, + bool& has3DNow, + bool& hasSSE3, + bool& hasSSSE3, + bool& hasFMA3, + bool& hasSSE41, + bool& hasSSE42, + bool& hasAVX, + bool& hasFMA4, + bool& hasAVX2, + bool& hasAVX512F, + bool& hasAVX512DQ, + bool& hasAVX512IFMA, + bool& hasAVX512PF, + bool& hasAVX512ER, + bool& hasAVX512CD, + bool& hasAVX512BW, + bool& hasAVX512VL, + bool& hasAVX512VBMI, + bool& hasAVX512VPOPCNTDQ) +{ + uint32 a = 0, b = 0, d = 0, c = 0; + SystemStatsHelpers::doCPUID (a, b, c, d, 1); + + hasMMX = (d & (1u << 23)) != 0; + hasSSE = (d & (1u << 25)) != 0; + hasSSE2 = (d & (1u << 26)) != 0; + has3DNow = (b & (1u << 31)) != 0; + hasSSE3 = (c & (1u << 0)) != 0; + hasSSSE3 = (c & (1u << 9)) != 0; + hasFMA3 = (c & (1u << 12)) != 0; + hasSSE41 = (c & (1u << 19)) != 0; + hasSSE42 = (c & (1u << 20)) != 0; + hasAVX = (c & (1u << 28)) != 0; + + SystemStatsHelpers::doCPUID (a, b, c, d, 0x80000001); + hasFMA4 = (c & (1u << 16)) != 0; + + SystemStatsHelpers::doCPUID (a, b, c, d, 7); + hasAVX2 = (b & (1u << 5)) != 0; + hasAVX512F = (b & (1u << 16)) != 0; + hasAVX512DQ = (b & (1u << 17)) != 0; + hasAVX512IFMA = (b & (1u << 21)) != 0; + hasAVX512PF = (b & (1u << 26)) != 0; + hasAVX512ER = (b & (1u << 27)) != 0; + hasAVX512CD = (b & (1u << 28)) != 0; + hasAVX512BW = (b & (1u << 30)) != 0; + hasAVX512VL = (b & (1u << 31)) != 0; + hasAVX512VBMI = (c & (1u << 1)) != 0; + hasAVX512VPOPCNTDQ = (c & (1u << 14)) != 0; +} + +} // namespace SystemStatsHelpers + +#endif + +} // namespace juce diff --git a/modules/juce_core/native/juce_linux_CommonFile.cpp b/modules/juce_core/native/juce_linux_CommonFile.cpp index b0a85a3cfc..13d37c0ed4 100644 --- a/modules/juce_core/native/juce_linux_CommonFile.cpp +++ b/modules/juce_core/native/juce_linux_CommonFile.cpp @@ -62,8 +62,9 @@ bool File::isSymbolicLink() const String File::getNativeLinkedTarget() const { - HeapBlock buffer (8194); - const int numBytes = (int) readlink (getFullPathName().toRawUTF8(), buffer, 8192); + constexpr int bufferSize = 8194; + HeapBlock buffer (bufferSize); + auto numBytes = (int) readlink (getFullPathName().toRawUTF8(), buffer, bufferSize - 2); return String::fromUTF8 (buffer, jmax (0, numBytes)); } diff --git a/modules/juce_core/native/juce_linux_Files.cpp b/modules/juce_core/native/juce_linux_Files.cpp index bd688d2182..99893aaa0d 100644 --- a/modules/juce_core/native/juce_linux_Files.cpp +++ b/modules/juce_core/native/juce_linux_Files.cpp @@ -20,6 +20,10 @@ ============================================================================== */ +#if JUCE_BSD +extern char** environ; +#endif + namespace juce { @@ -149,8 +153,12 @@ File File::getSpecialLocation (const SpecialLocationType type) case hostApplicationPath: { + #if JUCE_BSD + return juce_getExecutableFile(); + #else const File f ("/proc/self/exe"); return f.isSymbolicLink() ? f.getLinkedTarget() : juce_getExecutableFile(); + #endif } default: diff --git a/modules/juce_core/native/juce_linux_Network.cpp b/modules/juce_core/native/juce_linux_Network.cpp index c8949fd78c..0e410a5b6d 100644 --- a/modules/juce_core/native/juce_linux_Network.cpp +++ b/modules/juce_core/native/juce_linux_Network.cpp @@ -25,6 +25,26 @@ namespace juce void MACAddress::findAllAddresses (Array& result) { + #if JUCE_BSD + struct ifaddrs* addrs = nullptr; + + if (getifaddrs (&addrs) != -1) + { + for (auto* i = addrs; i != nullptr; i = i->ifa_next) + { + if (i->ifa_addr->sa_family == AF_LINK) + { + struct sockaddr_dl* sdl = (struct sockaddr_dl*) i->ifa_addr; + MACAddress ma ((const uint8*) (sdl->sdl_data + sdl->sdl_nlen)); + + if (! ma.isNull()) + result.addIfNotAlreadyThere (ma); + } + } + + freeifaddrs (addrs); + } + #else auto s = socket (AF_INET, SOCK_DGRAM, 0); if (s != -1) @@ -53,6 +73,7 @@ void MACAddress::findAllAddresses (Array& result) ::close (s); } + #endif } diff --git a/modules/juce_core/native/juce_linux_SystemStats.cpp b/modules/juce_core/native/juce_linux_SystemStats.cpp index cd3068e6e7..d3663497c9 100644 --- a/modules/juce_core/native/juce_linux_SystemStats.cpp +++ b/modules/juce_core/native/juce_linux_SystemStats.cpp @@ -27,6 +27,22 @@ extern "C" int cobalt_thread_mode(); namespace juce { +#if ! JUCE_BSD +static String getCpuInfo (const char* key) +{ + return readPosixConfigFileValue ("/proc/cpuinfo", key); +} + +static String getLocaleValue (nl_item key) +{ + auto oldLocale = ::setlocale (LC_ALL, ""); + auto result = String::fromUTF8 (nl_langinfo (key)); + ::setlocale (LC_ALL, oldLocale); + return result; +} +#endif + +//============================================================================== void Logger::outputDebugString (const String& text) { std::cerr << text << std::endl; @@ -54,14 +70,25 @@ bool SystemStats::isOperatingSystem64Bit() } //============================================================================== -static String getCpuInfo (const char* key) -{ - return readPosixConfigFileValue ("/proc/cpuinfo", key); -} - String SystemStats::getDeviceDescription() { + #if JUCE_BSD + int mib[] = { + CTL_HW, + HW_MACHINE + }; + size_t machineDescriptionLength = 0; + auto result = sysctl (mib, numElementsInArray (mib), nullptr, &machineDescriptionLength, nullptr, 0); + + if (result != 0 || machineDescriptionLength == 0) + return {}; + + MemoryBlock machineDescription { machineDescriptionLength }; + result = sysctl (mib, numElementsInArray (mib), machineDescription.getData(), &machineDescriptionLength, nullptr, 0); + return String::fromUTF8 (result == 0 ? (char*) machineDescription.getData() : ""); + #else return getCpuInfo ("Hardware"); + #endif } String SystemStats::getDeviceManufacturer() @@ -71,32 +98,70 @@ String SystemStats::getDeviceManufacturer() String SystemStats::getCpuVendor() { + #if JUCE_BSD + return {}; + #else auto v = getCpuInfo ("vendor_id"); if (v.isEmpty()) v = getCpuInfo ("model name"); return v; + #endif } String SystemStats::getCpuModel() { + #if JUCE_BSD + int mib[] = { + CTL_HW, + HW_MODEL + }; + size_t modelLength = 0; + auto result = sysctl (mib, numElementsInArray (mib), nullptr, &modelLength, nullptr, 0); + + if (result != 0 || modelLength == 0) + return {}; + + MemoryBlock model { modelLength }; + result = sysctl (mib, numElementsInArray (mib), model.getData(), &modelLength, nullptr, 0); + return String::fromUTF8 (result == 0 ? (char*) model.getData() : ""); + #else return getCpuInfo ("model name"); + #endif } int SystemStats::getCpuSpeedInMegahertz() { + #if JUCE_BSD + int32 clockRate = 0; + auto clockRateSize = sizeof (clockRate); + auto result = sysctlbyname ("hw.clockrate", &clockRate, &clockRateSize, nullptr, 0); + return result == 0 ? clockRate : 0; + #else return roundToInt (getCpuInfo ("cpu MHz").getFloatValue()); + #endif } int SystemStats::getMemorySizeInMegabytes() { + #if JUCE_BSD + int mib[] = { + CTL_HW, + HW_PHYSMEM + }; + int64 memory = 0; + auto memorySize = sizeof (memory); + auto result = sysctl (mib, numElementsInArray (mib), &memory, &memorySize, nullptr, 0); + return result == 0 ? (int) (memory / 1e6) : 0; + #else struct sysinfo sysi; if (sysinfo (&sysi) == 0) return (int) (sysi.totalram * sysi.mem_unit / (1024 * 1024)); return 0; + #endif } int SystemStats::getPageSize() @@ -131,21 +196,79 @@ String SystemStats::getComputerName() return {}; } -static String getLocaleValue (nl_item key) +String SystemStats::getUserLanguage() { - auto oldLocale = ::setlocale (LC_ALL, ""); - auto result = String::fromUTF8 (nl_langinfo (key)); - ::setlocale (LC_ALL, oldLocale); - return result; + #if JUCE_BSD + if (auto langEnv = getenv ("LANG")) + return String::fromUTF8 (langEnv).upToLastOccurrenceOf (".UTF-8", false, true); + + return {}; + #else + return getLocaleValue (_NL_IDENTIFICATION_LANGUAGE); + #endif } -String SystemStats::getUserLanguage() { return getLocaleValue (_NL_IDENTIFICATION_LANGUAGE); } -String SystemStats::getUserRegion() { return getLocaleValue (_NL_IDENTIFICATION_TERRITORY); } -String SystemStats::getDisplayLanguage() { return getUserLanguage() + "-" + getUserRegion(); } +String SystemStats::getUserRegion() +{ + #if JUCE_BSD + return {}; + #else + return getLocaleValue (_NL_IDENTIFICATION_TERRITORY); + #endif +} + +String SystemStats::getDisplayLanguage() +{ + auto result = getUserLanguage(); + auto region = getUserRegion(); + + if (region.isNotEmpty()) + result << "-" << region; + + return result; +} //============================================================================== void CPUInformation::initialise() noexcept { + #if JUCE_BSD + #if JUCE_INTEL && ! JUCE_NO_INLINE_ASM + SystemStatsHelpers::getCPUInfo (hasMMX, + hasSSE, + hasSSE2, + has3DNow, + hasSSE3, + hasSSSE3, + hasFMA3, + hasSSE41, + hasSSE42, + hasAVX, + hasFMA4, + hasAVX2, + hasAVX512F, + hasAVX512DQ, + hasAVX512IFMA, + hasAVX512PF, + hasAVX512ER, + hasAVX512CD, + hasAVX512BW, + hasAVX512VL, + hasAVX512VBMI, + hasAVX512VPOPCNTDQ); + #endif + + numLogicalCPUs = numPhysicalCPUs = [] + { + int mib[] = { + CTL_HW, + HW_NCPU + }; + int32 numCPUs = 1; + auto numCPUsSize = sizeof (numCPUs); + auto result = sysctl (mib, numElementsInArray (mib), &numCPUs, &numCPUsSize, nullptr, 0); + return result == 0 ? numCPUs : 1; + }(); + #else auto flags = getCpuInfo ("flags"); hasMMX = flags.contains ("mmx"); @@ -178,6 +301,7 @@ void CPUInformation::initialise() noexcept if (numPhysicalCPUs <= 0) numPhysicalCPUs = numLogicalCPUs; + #endif } //============================================================================== @@ -224,7 +348,17 @@ bool Time::setSystemTimeToThisTime() const JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger() noexcept { #if JUCE_BSD - return false; + int mib[] = + { + CTL_KERN, + KERN_PROC, + KERN_PROC_PID, + ::getpid() + }; + struct kinfo_proc info; + auto infoSize = sizeof (info); + auto result = sysctl (mib, numElementsInArray (mib), &info, &infoSize, nullptr, 0); + return result == 0 ? ((info.ki_flag & P_TRACED) != 0) : false; #else return readPosixConfigFileValue ("/proc/self/status", "TracerPid").getIntValue() > 0; #endif diff --git a/modules/juce_core/native/juce_mac_SystemStats.mm b/modules/juce_core/native/juce_mac_SystemStats.mm index 6d999ba3bc..96341c3a59 100644 --- a/modules/juce_core/native/juce_mac_SystemStats.mm +++ b/modules/juce_core/native/juce_mac_SystemStats.mm @@ -43,64 +43,32 @@ void Logger::outputDebugString (const String& text) fflush (stderr); } -//============================================================================== -namespace SystemStatsHelpers -{ - #if JUCE_INTEL && ! JUCE_NO_INLINE_ASM - static void doCPUID (uint32& a, uint32& b, uint32& c, uint32& d, uint32 type) - { - uint32 la = a, lb = b, lc = c, ld = d; - - #if JUCE_32BIT && defined (__pic__) - asm ("mov %%ebx, %%edi\n" - "cpuid\n" - "xchg %%edi, %%ebx\n" - : "=a" (la), "=D" (lb), "=c" (lc), "=d" (ld) - : "a" (type), "c" (0)); - #else - asm ("cpuid\n" - : "=a" (la), "=b" (lb), "=c" (lc), "=d" (ld) - : "a" (type), "c" (0)); - #endif - - a = la; b = lb; c = lc; d = ld; - } - #endif -} - //============================================================================== void CPUInformation::initialise() noexcept { #if JUCE_INTEL && ! JUCE_NO_INLINE_ASM - uint32 a = 0, b = 0, d = 0, c = 0; - SystemStatsHelpers::doCPUID (a, b, c, d, 1); - - hasMMX = (d & (1u << 23)) != 0; - hasSSE = (d & (1u << 25)) != 0; - hasSSE2 = (d & (1u << 26)) != 0; - has3DNow = (b & (1u << 31)) != 0; - hasSSE3 = (c & (1u << 0)) != 0; - hasSSSE3 = (c & (1u << 9)) != 0; - hasFMA3 = (c & (1u << 12)) != 0; - hasSSE41 = (c & (1u << 19)) != 0; - hasSSE42 = (c & (1u << 20)) != 0; - hasAVX = (c & (1u << 28)) != 0; - - SystemStatsHelpers::doCPUID (a, b, c, d, 0x80000001); - hasFMA4 = (c & (1u << 16)) != 0; - - SystemStatsHelpers::doCPUID (a, b, c, d, 7); - hasAVX2 = (b & (1u << 5)) != 0; - hasAVX512F = (b & (1u << 16)) != 0; - hasAVX512DQ = (b & (1u << 17)) != 0; - hasAVX512IFMA = (b & (1u << 21)) != 0; - hasAVX512PF = (b & (1u << 26)) != 0; - hasAVX512ER = (b & (1u << 27)) != 0; - hasAVX512CD = (b & (1u << 28)) != 0; - hasAVX512BW = (b & (1u << 30)) != 0; - hasAVX512VL = (b & (1u << 31)) != 0; - hasAVX512VBMI = (c & (1u << 1)) != 0; - hasAVX512VPOPCNTDQ = (c & (1u << 14)) != 0; + SystemStatsHelpers::getCPUInfo (hasMMX, + hasSSE, + hasSSE2, + has3DNow, + hasSSE3, + hasSSSE3, + hasFMA3, + hasSSE41, + hasSSE42, + hasAVX, + hasFMA4, + hasAVX2, + hasAVX512F, + hasAVX512DQ, + hasAVX512IFMA, + hasAVX512PF, + hasAVX512ER, + hasAVX512CD, + hasAVX512BW, + hasAVX512VL, + hasAVX512VBMI, + hasAVX512VPOPCNTDQ); #endif numLogicalCPUs = (int) [[NSProcessInfo processInfo] activeProcessorCount]; diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index 082a5697a6..e2af54133b 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -59,7 +59,7 @@ void JUCE_CALLTYPE Process::terminate() } -#if JUCE_MAC || JUCE_LINUX +#if JUCE_MAC || JUCE_LINUX || JUCE_BSD bool Process::setMaxNumberOfFileHandles (int newMaxNumber) noexcept { rlimit lim; @@ -260,7 +260,7 @@ uint64 File::getFileIdentifier() const static bool hasEffectiveRootFilePermissions() { - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD return geteuid() == 0; #else return false; @@ -940,9 +940,10 @@ void JUCE_CALLTYPE Thread::setCurrentThreadName (const String& name) { [[NSThread currentThread] setName: juceStringToNS (name)]; } - #elif JUCE_LINUX || JUCE_ANDROID - #if ((JUCE_LINUX && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012) \ - || JUCE_ANDROID && __ANDROID_API__ >= 9) + #elif JUCE_LINUX || JUCE_BSD || JUCE_ANDROID + #if (JUCE_BSD \ + || (JUCE_LINUX && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012) \ + || (JUCE_ANDROID && __ANDROID_API__ >= 9)) pthread_setname_np (pthread_self(), name.toRawUTF8()); #else prctl (PR_SET_NAME, name.toRawUTF8(), 0, 0, 0); @@ -1000,7 +1001,7 @@ void JUCE_CALLTYPE Thread::setCurrentThreadAffinityMask (uint32 affinityMask) if ((affinityMask & (uint32) (1 << i)) != 0) CPU_SET ((size_t) i, &affinity); - #if (! JUCE_ANDROID) && ((! JUCE_LINUX) || ((__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2004)) + #if (! JUCE_ANDROID) && ((! (JUCE_LINUX || JUCE_BSD)) || ((__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2004)) pthread_setaffinity_np (pthread_self(), sizeof (cpu_set_t), &affinity); #elif JUCE_ANDROID sched_setaffinity (gettid(), sizeof (cpu_set_t), &affinity); diff --git a/modules/juce_core/network/juce_Socket.cpp b/modules/juce_core/network/juce_Socket.cpp index a43cb141db..ef313c2a7b 100644 --- a/modules/juce_core/network/juce_Socket.cpp +++ b/modules/juce_core/network/juce_Socket.cpp @@ -132,7 +132,7 @@ namespace SocketHelpers // a chance to process before close is called. On Mac OS X shutdown // does not unblock a select call, so using a lock here will dead-lock // both threads. - #if JUCE_LINUX || JUCE_ANDROID + #if JUCE_LINUX || JUCE_BSD || JUCE_ANDROID CriticalSection::ScopedLockType lock (readLock); ::close (h); #else @@ -780,7 +780,7 @@ bool DatagramSocket::setEnablePortReuse (bool enabled) #else if (handle >= 0) return SocketHelpers::setOption ((SocketHandle) handle.load(), - #if JUCE_WINDOWS || JUCE_LINUX + #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD SO_REUSEADDR, // port re-use is implied by addr re-use on these platforms #else SO_REUSEPORT, diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h index 8df78273a4..4e94c966e7 100644 --- a/modules/juce_core/system/juce_PlatformDefs.h +++ b/modules/juce_core/system/juce_PlatformDefs.h @@ -59,7 +59,7 @@ namespace juce #endif //============================================================================== -#if JUCE_IOS || (JUCE_MAC && JUCE_ARM) || JUCE_LINUX +#if JUCE_IOS || (JUCE_MAC && JUCE_ARM) || JUCE_LINUX || JUCE_BSD /** This will try to break into the debugger if the app is currently being debugged. If called by an app that's not being debugged, the behaviour isn't defined - it may crash or not, depending on the platform. diff --git a/modules/juce_core/system/juce_StandardHeader.h b/modules/juce_core/system/juce_StandardHeader.h index a4329828f4..226b91030c 100644 --- a/modules/juce_core/system/juce_StandardHeader.h +++ b/modules/juce_core/system/juce_StandardHeader.h @@ -83,7 +83,7 @@ JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4514 4245 4100) #include #endif -#if JUCE_LINUX +#if JUCE_LINUX || JUCE_BSD #include #include diff --git a/modules/juce_core/system/juce_TargetPlatform.h b/modules/juce_core/system/juce_TargetPlatform.h index 5b4d293bb6..a062d5d321 100644 --- a/modules/juce_core/system/juce_TargetPlatform.h +++ b/modules/juce_core/system/juce_TargetPlatform.h @@ -154,7 +154,7 @@ #endif //============================================================================== -#if JUCE_LINUX || JUCE_ANDROID +#if JUCE_LINUX || JUCE_ANDROID || JUCE_BSD #ifdef _DEBUG #define JUCE_DEBUG 1 diff --git a/modules/juce_core/text/juce_CharPointer_ASCII.h b/modules/juce_core/text/juce_CharPointer_ASCII.h index d84b19d5b7..2d3a176d69 100644 --- a/modules/juce_core/text/juce_CharPointer_ASCII.h +++ b/modules/juce_core/text/juce_CharPointer_ASCII.h @@ -335,7 +335,7 @@ public: /** Parses this string as a 64-bit integer. */ int64 getIntValue64() const noexcept { - #if JUCE_LINUX || JUCE_ANDROID || JUCE_MINGW + #if JUCE_LINUX || JUCE_BSD || JUCE_ANDROID || JUCE_MINGW return atoll (data); #elif JUCE_WINDOWS return _atoi64 (data); diff --git a/modules/juce_core/threads/juce_ChildProcess.cpp b/modules/juce_core/threads/juce_ChildProcess.cpp index 3b284c25a0..2e5f143309 100644 --- a/modules/juce_core/threads/juce_ChildProcess.cpp +++ b/modules/juce_core/threads/juce_ChildProcess.cpp @@ -96,7 +96,7 @@ public: { beginTest ("Child Processes"); - #if JUCE_WINDOWS || JUCE_MAC || JUCE_LINUX + #if JUCE_WINDOWS || JUCE_MAC || JUCE_LINUX || JUCE_BSD ChildProcess p; #if JUCE_WINDOWS diff --git a/modules/juce_core/threads/juce_Process.h b/modules/juce_core/threads/juce_Process.h index 17fa8aa4e5..e4f92c8896 100644 --- a/modules/juce_core/threads/juce_Process.h +++ b/modules/juce_core/threads/juce_Process.h @@ -139,7 +139,7 @@ public: static void setDockIconVisible (bool isVisible); #endif - #if JUCE_MAC || JUCE_LINUX || DOXYGEN + #if JUCE_MAC || JUCE_LINUX || JUCE_BSD || DOXYGEN //============================================================================== /** UNIX ONLY - Attempts to use setrlimit to change the maximum number of file handles that the app can open. Pass 0 or less as the parameter to mean diff --git a/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp b/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp index bc1d1a110c..472543d9f1 100644 --- a/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp +++ b/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp @@ -89,7 +89,7 @@ File PropertiesFile::Options::getDefaultFile() const if (folderName.isNotEmpty()) dir = dir.getChildFile (folderName); - #elif JUCE_LINUX || JUCE_ANDROID + #elif JUCE_LINUX || JUCE_BSD || JUCE_ANDROID auto dir = File (commonToAllUsers ? "/var" : "~") .getChildFile (folderName.isNotEmpty() ? folderName : ("." + applicationName)); diff --git a/modules/juce_events/juce_events.cpp b/modules/juce_events/juce_events.cpp index b2760a94d4..b7d8834cea 100644 --- a/modules/juce_events/juce_events.cpp +++ b/modules/juce_events/juce_events.cpp @@ -49,7 +49,7 @@ #import #import -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD #include #endif @@ -85,7 +85,7 @@ #include "native/juce_win32_WinRTWrapper.cpp" #endif -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD #include "native/juce_linux_Messaging.cpp" #elif JUCE_ANDROID diff --git a/modules/juce_events/juce_events.h b/modules/juce_events/juce_events.h index dc804d8a5a..f7fb283c1e 100644 --- a/modules/juce_events/juce_events.h +++ b/modules/juce_events/juce_events.h @@ -90,7 +90,7 @@ #include "interprocess/juce_ConnectedChildProcess.h" #include "interprocess/juce_NetworkServiceDiscovery.h" -#if JUCE_LINUX +#if JUCE_LINUX || JUCE_BSD #include "native/juce_linux_EventLoop.h" #endif diff --git a/modules/juce_events/messages/juce_ApplicationBase.cpp b/modules/juce_events/messages/juce_ApplicationBase.cpp index 209403ef6c..d1936b0f83 100644 --- a/modules/juce_events/messages/juce_ApplicationBase.cpp +++ b/modules/juce_events/messages/juce_ApplicationBase.cpp @@ -183,7 +183,7 @@ StringArray JUCE_CALLTYPE JUCEApplicationBase::getCommandLineParameterArray() extern void initialiseNSApplication(); #endif -#if JUCE_LINUX && JUCE_MODULE_AVAILABLE_juce_gui_extra && (! defined(JUCE_WEB_BROWSER) || JUCE_WEB_BROWSER) +#if (JUCE_LINUX || JUCE_BSD) && JUCE_MODULE_AVAILABLE_juce_gui_extra && (! defined(JUCE_WEB_BROWSER) || JUCE_WEB_BROWSER) extern int juce_gtkWebkitMain (int argc, const char* argv[]); #endif @@ -228,7 +228,7 @@ int JUCEApplicationBase::main (int argc, const char* argv[]) initialiseNSApplication(); #endif - #if JUCE_LINUX && JUCE_MODULE_AVAILABLE_juce_gui_extra && (! defined(JUCE_WEB_BROWSER) || JUCE_WEB_BROWSER) + #if (JUCE_LINUX || JUCE_BSD) && JUCE_MODULE_AVAILABLE_juce_gui_extra && (! defined(JUCE_WEB_BROWSER) || JUCE_WEB_BROWSER) if (argc >= 2 && String (argv[1]) == "--juce-gtkwebkitfork-child") return juce_gtkWebkitMain (argc, argv); #endif diff --git a/modules/juce_graphics/images/juce_Image.cpp b/modules/juce_graphics/images/juce_Image.cpp index f6560e30c0..36d4ad0a6d 100644 --- a/modules/juce_graphics/images/juce_Image.cpp +++ b/modules/juce_graphics/images/juce_Image.cpp @@ -144,7 +144,7 @@ int NativeImageType::getTypeID() const return 1; } -#if JUCE_WINDOWS || JUCE_LINUX +#if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD ImagePixelData::Ptr NativeImageType::create (Image::PixelFormat format, int width, int height, bool clearImage) const { return new SoftwarePixelData (format, width, height, clearImage); diff --git a/modules/juce_graphics/juce_graphics.cpp b/modules/juce_graphics/juce_graphics.cpp index 4b2bd32170..fd45e45fbe 100644 --- a/modules/juce_graphics/juce_graphics.cpp +++ b/modules/juce_graphics/juce_graphics.cpp @@ -75,7 +75,7 @@ #import #import -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD #ifndef JUCE_USE_FREETYPE #define JUCE_USE_FREETYPE 1 #endif @@ -147,7 +147,7 @@ #include "native/juce_win32_Direct2DGraphicsContext.cpp" #endif -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD #include "native/juce_linux_Fonts.cpp" #include "native/juce_linux_IconHelpers.cpp" diff --git a/modules/juce_graphics/native/juce_linux_Fonts.cpp b/modules/juce_graphics/native/juce_linux_Fonts.cpp index fbb000d252..580a1372de 100644 --- a/modules/juce_graphics/native/juce_linux_Fonts.cpp +++ b/modules/juce_graphics/native/juce_linux_Fonts.cpp @@ -29,7 +29,8 @@ namespace juce static std::unique_ptr findFontsConfFile() { static const char* pathsToSearch[] = { "/etc/fonts/fonts.conf", - "/usr/share/fonts/fonts.conf" }; + "/usr/share/fonts/fonts.conf", + "/usr/local/etc/fonts/fonts.conf" }; for (auto* path : pathsToSearch) if (auto xml = parseXML (File (path))) diff --git a/modules/juce_gui_basics/components/juce_Component.cpp b/modules/juce_gui_basics/components/juce_Component.cpp index c4404c637a..028eac61ef 100644 --- a/modules/juce_gui_basics/components/juce_Component.cpp +++ b/modules/juce_gui_basics/components/juce_Component.cpp @@ -626,7 +626,7 @@ void Component::addToDesktop (int styleWanted, void* nativeWindowToAttachTo) { const WeakReference safePointer (this); - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD // it's wise to give the component a non-zero size before // putting it on the desktop, as X windows get confused by this, and // a (1, 1) minimum size is enforced here. diff --git a/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp index f7de6d621a..df2add3a06 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp @@ -441,7 +441,7 @@ void FileBrowserComponent::browserRootChanged (const File&) {} bool FileBrowserComponent::keyPressed (const KeyPress& key) { - #if JUCE_LINUX || JUCE_WINDOWS + #if JUCE_LINUX || JUCE_BSD || JUCE_WINDOWS if (key.getModifiers().isCommandDown() && (key.getKeyCode() == 'H' || key.getKeyCode() == 'h')) { diff --git a/modules/juce_gui_basics/juce_gui_basics.cpp b/modules/juce_gui_basics/juce_gui_basics.cpp index 12a815f6ba..849629c9ee 100644 --- a/modules/juce_gui_basics/juce_gui_basics.cpp +++ b/modules/juce_gui_basics/juce_gui_basics.cpp @@ -253,7 +253,7 @@ namespace juce #include "native/juce_win32_DragAndDrop.cpp" #include "native/juce_win32_FileChooser.cpp" -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD #include "native/x11/juce_linux_X11_Symbols.cpp" #include "native/x11/juce_linux_X11_DragAndDrop.cpp" diff --git a/modules/juce_gui_basics/juce_gui_basics.h b/modules/juce_gui_basics/juce_gui_basics.h index a9258b86de..de622b2e5b 100644 --- a/modules/juce_gui_basics/juce_gui_basics.h +++ b/modules/juce_gui_basics/juce_gui_basics.h @@ -294,7 +294,7 @@ namespace juce #include "lookandfeel/juce_LookAndFeel_V4.h" #include "mouse/juce_LassoComponent.h" -#if JUCE_LINUX +#if JUCE_LINUX || JUCE_BSD #if JUCE_GUI_BASICS_INCLUDE_XHEADERS // If you're missing these headers, you need to install the libx11-dev package #include diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp index f0bd1e124c..6ed39e1a9d 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp @@ -182,7 +182,7 @@ void LookAndFeel::setUsingNativeAlertWindows (bool shouldUseNativeAlerts) bool LookAndFeel::isUsingNativeAlertWindows() { - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD return false; // not available currently.. #else return useNativeAlertWindows; diff --git a/modules/juce_gui_basics/windows/juce_AlertWindow.cpp b/modules/juce_gui_basics/windows/juce_AlertWindow.cpp index 06e66686b3..c41874b567 100644 --- a/modules/juce_gui_basics/windows/juce_AlertWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_AlertWindow.cpp @@ -28,7 +28,7 @@ namespace juce static juce_wchar getDefaultPasswordChar() noexcept { - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD return 0x2022; #else return 0x25cf; diff --git a/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h b/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h index 9eb8e97b6f..b85de724c7 100644 --- a/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h +++ b/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h @@ -31,7 +31,7 @@ bool juce_handleXEmbedEvent (ComponentPeer*, void*); /** @internal */ unsigned long juce_getCurrentFocusWindow (ComponentPeer*); -#if JUCE_LINUX || DOXYGEN +#if JUCE_LINUX || JUCE_BSD || DOXYGEN //============================================================================== /** diff --git a/modules/juce_gui_extra/juce_gui_extra.cpp b/modules/juce_gui_extra/juce_gui_extra.cpp index 5dc0f13a2e..4a754e0edb 100755 --- a/modules/juce_gui_extra/juce_gui_extra.cpp +++ b/modules/juce_gui_extra/juce_gui_extra.cpp @@ -109,7 +109,7 @@ #endif //============================================================================== -#elif JUCE_LINUX && JUCE_WEB_BROWSER +#elif (JUCE_LINUX || JUCE_BSD) && JUCE_WEB_BROWSER JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-as-null-pointer-constant", "-Wparentheses") // If you're missing this header, you need to install the webkit2gtk-4.0 package @@ -168,7 +168,7 @@ #include "native/juce_win32_SystemTrayIcon.cpp" //============================================================================== -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-as-null-pointer-constant") #include "native/juce_linux_XEmbedComponent.cpp" diff --git a/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.cpp b/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.cpp index 52cbf28b66..50717c380d 100644 --- a/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.cpp +++ b/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.cpp @@ -26,7 +26,7 @@ namespace juce { -#if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC +#if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD || JUCE_MAC SystemTrayIconComponent::SystemTrayIconComponent() { diff --git a/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.h b/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.h index b5241d5bdc..b3fa298f2a 100644 --- a/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.h +++ b/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.h @@ -26,7 +26,7 @@ namespace juce { -#if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC || DOXYGEN +#if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD || JUCE_MAC || DOXYGEN //============================================================================== @@ -91,7 +91,7 @@ public: */ void* getNativeHandle() const; - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD /** @internal */ void paint (Graphics&) override; #endif diff --git a/modules/juce_opengl/juce_opengl.cpp b/modules/juce_opengl/juce_opengl.cpp index b6b4e6daeb..966e096106 100644 --- a/modules/juce_opengl/juce_opengl.cpp +++ b/modules/juce_opengl/juce_opengl.cpp @@ -54,7 +54,7 @@ #endif //============================================================================== -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD /* Got an include error here? If you want to install OpenGL support, the packages to get are "mesa-common-dev" @@ -91,7 +91,7 @@ namespace juce void OpenGLExtensionFunctions::initialise() { - #if JUCE_WINDOWS || JUCE_LINUX + #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD #define JUCE_INIT_GL_FUNCTION(name, returnType, params, callparams) \ name = (type_ ## name) OpenGLHelpers::getExtensionFunction (#name); @@ -273,7 +273,7 @@ private: #elif JUCE_WINDOWS #include "native/juce_OpenGL_win32.h" -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD #include "native/juce_OpenGL_linux_X11.h" #elif JUCE_ANDROID diff --git a/modules/juce_opengl/juce_opengl.h b/modules/juce_opengl/juce_opengl.h index a2579b3a6c..701660fe22 100644 --- a/modules/juce_opengl/juce_opengl.h +++ b/modules/juce_opengl/juce_opengl.h @@ -88,7 +88,7 @@ #undef APIENTRY #undef CLEAR_TEMP_APIENTRY #endif -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD #include #undef KeyPress #elif JUCE_IOS diff --git a/modules/juce_opengl/native/juce_OpenGLExtensions.h b/modules/juce_opengl/native/juce_OpenGLExtensions.h index e7eab9dbf2..9da5f05c8d 100644 --- a/modules/juce_opengl/native/juce_OpenGLExtensions.h +++ b/modules/juce_opengl/native/juce_OpenGLExtensions.h @@ -119,7 +119,7 @@ struct OpenGLExtensionFunctions #endif //============================================================================== - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD #define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) typedef returnType (*type_ ## name) params; type_ ## name name; JUCE_GL_BASE_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION) JUCE_GL_EXTENSION_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION) diff --git a/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp b/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp index 2e5e3a0677..f76c976fdf 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp @@ -39,7 +39,7 @@ public: // context. You'll need to create this object in one of the OpenGLContext's callbacks. jassert (OpenGLHelpers::isContextActive()); - #if JUCE_WINDOWS || JUCE_LINUX + #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD if (context.extensions.glGenFramebuffers == nullptr) return; #endif diff --git a/modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp b/modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp index 97dc1f0b58..d3aae888f8 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp @@ -35,7 +35,7 @@ void* OpenGLHelpers::getExtensionFunction (const char* functionName) { #if JUCE_WINDOWS return (void*) wglGetProcAddress (functionName); - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD return (void*) glXGetProcAddress ((const GLubyte*) functionName); #else static void* handle = dlopen (nullptr, RTLD_LAZY); diff --git a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp index 8060740a71..28b0c72505 100644 --- a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp +++ b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp @@ -151,7 +151,7 @@ struct OnlineUnlockForm::OverlayComp : public Component, static juce_wchar getDefaultPasswordChar() noexcept { - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD return 0x2022; #else return 0x25cf; diff --git a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp index 4fb324ba7d..83a6334d67 100644 --- a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp +++ b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp @@ -280,6 +280,8 @@ char OnlineUnlockStatus::MachineIDUtilities::getPlatformPrefix() return 'W'; #elif JUCE_LINUX return 'L'; + #elif JUCE_BSD + return 'B'; #elif JUCE_IOS return 'I'; #elif JUCE_ANDROID diff --git a/modules/juce_video/playback/juce_VideoComponent.cpp b/modules/juce_video/playback/juce_VideoComponent.cpp index 9ffc310a91..c4cf0ad4dc 100644 --- a/modules/juce_video/playback/juce_VideoComponent.cpp +++ b/modules/juce_video/playback/juce_VideoComponent.cpp @@ -26,7 +26,7 @@ namespace juce { -#if ! (JUCE_LINUX || JUCE_PROJUCER_LIVE_BUILD) +#if ! (JUCE_LINUX || JUCE_BSD || JUCE_PROJUCER_LIVE_BUILD) #if JUCE_MAC || JUCE_IOS #include "../native/juce_mac_Video.h"