From d6a43fad90411604d66f9fb00479ec9c1c7cbdc9 Mon Sep 17 00:00:00 2001 From: leo60228 Date: Thu, 21 Sep 2023 17:49:01 -0400 Subject: [PATCH] Fix compiler warnings on Android --- desktop_version/CMakeLists.txt | 5 +++++ desktop_version/src/FileSystemUtils.cpp | 2 ++ desktop_version/src/Vlogging.c | 7 ++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt index 52a0145e..f7fb2c18 100644 --- a/desktop_version/CMakeLists.txt +++ b/desktop_version/CMakeLists.txt @@ -274,6 +274,11 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options(VVVVVV PRIVATE -Wno-c++11-long-long) endif() +# Disable warnings about flexible array members in C++ (from including FAudio) +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_options(VVVVVV PRIVATE -Wno-c99-extensions) +endif() + if(MSVC) # MSVC doesn't have /std:c99 or /std:c++98 switches! diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp index 6a21468f..d9813d56 100644 --- a/desktop_version/src/FileSystemUtils.cpp +++ b/desktop_version/src/FileSystemUtils.cpp @@ -76,6 +76,7 @@ static const PHYSFS_Allocator allocator = { SDL_free }; +#ifndef __ANDROID__ static bool mount_pre_datazip( char* out_path, const char* real_dirname, @@ -174,6 +175,7 @@ static bool mount_pre_datazip( return dir_found; } +#endif int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath, char* langDir, char* fontsDir) { diff --git a/desktop_version/src/Vlogging.c b/desktop_version/src/Vlogging.c index fd1f5d2e..253e3369 100644 --- a/desktop_version/src/Vlogging.c +++ b/desktop_version/src/Vlogging.c @@ -24,8 +24,13 @@ #define Color_BOLD_RED COLOR("\x1b[1;31m") #define Color_BOLD_GRAY COLOR("\x1b[1;90m") -static int output_enabled = 1; +#ifdef __ANDROID__ +const int color_supported = 0; +#else static int color_supported = 0; +#endif + +static int output_enabled = 1; static int color_enabled = 1; static int debug_enabled = 0; static int info_enabled = 1;