diff --git a/CMakeLists.txt b/CMakeLists.txt index d5e032400e..ac9bb20326 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -358,6 +358,11 @@ else () set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=objc-method-access") endif() + # Clang -Wmissing-declarations differs from GCC, set -Wmissing-prototypes for parity + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wmissing-prototypes") + endif() + # On mingw all code is already PIC, this will avoid compiler error on redefining this option if (NOT MINGW) set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/src/openrct2/Version.cpp b/src/openrct2/Version.cpp index d88beed61b..37dffddad7 100644 --- a/src/openrct2/Version.cpp +++ b/src/openrct2/Version.cpp @@ -56,13 +56,19 @@ const char gVersionInfoFull[] = OPENRCT2_NAME ", " ; #ifdef __EMSCRIPTEN__ -// This must be wrapped in extern "C", according to the emscripten docs, "to prevent C++ name mangling" + // This must be wrapped in extern "C", according to the emscripten docs, "to prevent C++ name mangling" + // Ignore -Wmissing-prototypes here, see https://github.com/llvm/llvm-project/issues/94138 + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wmissing-prototypes" + extern "C" { const char* GetVersion() { return gVersionInfoFull; } } + + #pragma clang diagnostic pop #endif NewVersionInfo GetLatestVersion() diff --git a/src/openrct2/platform/Platform.macOS.mm b/src/openrct2/platform/Platform.macOS.mm index 2d412b56de..5235e0884f 100644 --- a/src/openrct2/platform/Platform.macOS.mm +++ b/src/openrct2/platform/Platform.macOS.mm @@ -155,7 +155,7 @@ namespace OpenRCT2::Platform return false; } - bool HasMatchingLanguage(NSString* preferredLocale, uint16_t* languageIdentifier) + static bool HasMatchingLanguage(NSString* preferredLocale, uint16_t* languageIdentifier) { @autoreleasepool {