From 43fafb45ef6ff32296c1c731a27c07bf91aeab46 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sat, 28 Nov 2020 17:02:25 -0330 Subject: [PATCH 1/3] Wrap json.hxx in another header, which disables warnings for code we don't control. Eventually we can add directives here for other compilers too (in json_lib.hxx). --- configure | 4 ---- src/common/JoyMap.hxx | 2 +- src/common/KeyMap.hxx | 2 +- src/common/PJoystickHandler.hxx | 2 +- src/common/PKeyboardHandler.cxx | 2 +- src/common/PhysicalJoystick.hxx | 2 +- src/common/jsonDefinitions.hxx | 2 +- src/json/json_lib.hxx | 34 +++++++++++++++++++++++++++++++++ 8 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 src/json/json_lib.hxx diff --git a/configure b/configure index fbc3c1b39..df1d43cfc 100755 --- a/configure +++ b/configure @@ -580,10 +580,6 @@ else darwin*) DEFINES="$DEFINES -DUNIX -DDARWIN" _host_os=darwin - if test "$have_clang" = yes; then - CXXFLAGS="$CXXFLAGS -Wno-documentation-unknown-command -Wno-documentation-pedantic -Wno-poison-system-directories" - CXXFLAGS="$CXXFLAGS -Wno-unknown-warning-option" - fi ;; irix*) DEFINES="$DEFINES -DUNIX" diff --git a/src/common/JoyMap.hxx b/src/common/JoyMap.hxx index 6bf87009e..9b77b09a1 100644 --- a/src/common/JoyMap.hxx +++ b/src/common/JoyMap.hxx @@ -22,7 +22,7 @@ #include "Event.hxx" #include "EventHandlerConstants.hxx" -#include "json.hxx" +#include "json_lib.hxx" /** This class handles controller mappings in Stella. diff --git a/src/common/KeyMap.hxx b/src/common/KeyMap.hxx index b5805225f..0a067eead 100644 --- a/src/common/KeyMap.hxx +++ b/src/common/KeyMap.hxx @@ -22,7 +22,7 @@ #include "Event.hxx" #include "EventHandlerConstants.hxx" #include "StellaKeys.hxx" -#include "json.hxx" +#include "json_lib.hxx" /** This class handles keyboard mappings in Stella. diff --git a/src/common/PJoystickHandler.hxx b/src/common/PJoystickHandler.hxx index 8e43bdf97..ebdec580e 100644 --- a/src/common/PJoystickHandler.hxx +++ b/src/common/PJoystickHandler.hxx @@ -28,7 +28,7 @@ class Event; #include "EventHandlerConstants.hxx" #include "PhysicalJoystick.hxx" #include "Variant.hxx" -#include "json.hxx" +#include "json_lib.hxx" using PhysicalJoystickPtr = shared_ptr; diff --git a/src/common/PKeyboardHandler.cxx b/src/common/PKeyboardHandler.cxx index 108a620b9..6b60ae914 100644 --- a/src/common/PKeyboardHandler.cxx +++ b/src/common/PKeyboardHandler.cxx @@ -19,7 +19,7 @@ #include "Console.hxx" #include "EventHandler.hxx" #include "PKeyboardHandler.hxx" -#include "json.hxx" +#include "json_lib.hxx" using json = nlohmann::json; diff --git a/src/common/PhysicalJoystick.hxx b/src/common/PhysicalJoystick.hxx index 454008f51..cf0456c0e 100644 --- a/src/common/PhysicalJoystick.hxx +++ b/src/common/PhysicalJoystick.hxx @@ -21,7 +21,7 @@ #include "Event.hxx" #include "EventHandlerConstants.hxx" #include "JoyMap.hxx" -#include "json.hxx" +#include "json_lib.hxx" /** An abstraction of a physical (real) joystick in Stella. diff --git a/src/common/jsonDefinitions.hxx b/src/common/jsonDefinitions.hxx index 595789845..a7a394f49 100644 --- a/src/common/jsonDefinitions.hxx +++ b/src/common/jsonDefinitions.hxx @@ -3,7 +3,7 @@ #include "EventHandlerConstants.hxx" #include "Event.hxx" -#include "json.hxx" +#include "json_lib.hxx" #include "StellaKeys.hxx" NLOHMANN_JSON_SERIALIZE_ENUM(JoyAxis, { diff --git a/src/json/json_lib.hxx b/src/json/json_lib.hxx new file mode 100644 index 000000000..30e93293d --- /dev/null +++ b/src/json/json_lib.hxx @@ -0,0 +1,34 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2020 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +//============================================================================ + +#ifndef JSON_LIB_HXX +#define JSON_LIB_HXX + +/* + * We can't control the quality of code from outside projects, so for now + * just disable warnings for it. + */ +#ifdef __clang__ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Weverything" + #include "json.hxx" + #pragma clang diagnostic pop +#else + #include "json.hxx" +#endif + +#endif // JSON_LIB_HXX From 9c9633e0c74a6f9a775c412b9e1addf51c6e88bd Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sat, 28 Nov 2020 17:11:10 -0330 Subject: [PATCH 2/3] Added json stuff to Visual Studio project file. --- src/windows/Stella.vcxproj | 18 ++++++++++-------- src/windows/Stella.vcxproj.filters | 9 +++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/windows/Stella.vcxproj b/src/windows/Stella.vcxproj index d1cf96c6b..c9acf6cf2 100644 --- a/src/windows/Stella.vcxproj +++ b/src/windows/Stella.vcxproj @@ -202,7 +202,7 @@ Disabled - ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories) + ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;..\json;%(AdditionalIncludeDirectories) BSPF_WINDOWS;WIN32;NOMINMAX;DEBUG_BUILD;SDL_SUPPORT;GUI_SUPPORT;PNG_SUPPORT;ZIP_SUPPORT;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) false EnableFastChecks @@ -236,7 +236,7 @@ Disabled - ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories) + ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;..\json;%(AdditionalIncludeDirectories) BSPF_WINDOWS;WIN32;NOMINMAX;DEBUG_BUILD;SDL_SUPPORT;GUI_SUPPORT;PNG_SUPPORT;ZIP_SUPPORT;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) false EnableFastChecks @@ -273,7 +273,7 @@ Disabled - ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories) + ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;..\json;%(AdditionalIncludeDirectories) BSPF_WINDOWS;WIN32;NOMINMAX;DEBUG_BUILD;SDL_SUPPORT;GUI_SUPPORT;PNG_SUPPORT;ZIP_SUPPORT;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) false EnableFastChecks @@ -309,7 +309,7 @@ Disabled - ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories) + ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;..\json;%(AdditionalIncludeDirectories) BSPF_WINDOWS;WIN32;NOMINMAX;DEBUG_BUILD;SDL_SUPPORT;GUI_SUPPORT;PNG_SUPPORT;ZIP_SUPPORT;JOYSTICK_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) false EnableFastChecks @@ -343,7 +343,7 @@ true true - ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories) + ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;..\json;%(AdditionalIncludeDirectories) BSPF_WINDOWS;WIN32;NOMINMAX;NDEBUG;SDL_SUPPORT;GUI_SUPPORT;PNG_SUPPORT;ZIP_SUPPORT;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) MultiThreadedDLL false @@ -378,7 +378,7 @@ true false - ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories) + ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;..\json;%(AdditionalIncludeDirectories) BSPF_WINDOWS;WIN32;NOMINMAX;NDEBUG;SDL_SUPPORT;GUI_SUPPORT;PNG_SUPPORT;ZIP_SUPPORT;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) MultiThreadedDLL false @@ -417,7 +417,7 @@ MaxSpeed AnySuitable true - ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories) + ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;..\json;%(AdditionalIncludeDirectories) BSPF_WINDOWS;WIN32;NOMINMAX;NDEBUG;SDL_SUPPORT;GUI_SUPPORT;PNG_SUPPORT;ZIP_SUPPORT;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) MultiThreadedDLL false @@ -456,7 +456,7 @@ Full Default true - ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories) + ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;..\json;%(AdditionalIncludeDirectories) BSPF_WINDOWS;WIN32;NOMINMAX;NDEBUG;SDL_SUPPORT;GUI_SUPPORT;PNG_SUPPORT;ZIP_SUPPORT;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) MultiThreadedDLL false @@ -1844,6 +1844,8 @@ + + diff --git a/src/windows/Stella.vcxproj.filters b/src/windows/Stella.vcxproj.filters index a8cac63d6..eeb74510f 100644 --- a/src/windows/Stella.vcxproj.filters +++ b/src/windows/Stella.vcxproj.filters @@ -70,6 +70,9 @@ {1aab46fa-ee39-415d-9e41-d5ad3ee14ce7} + + {966c18c1-dae3-4dae-8e00-c621187898b1} + @@ -2135,6 +2138,12 @@ Header Files\debugger + + Header Files\json + + + Header Files\json + From a47689c5107052c1009c9a0b7130a3779ed63b31 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sat, 28 Nov 2020 17:33:46 -0330 Subject: [PATCH 3/3] libretro: Add JSON stuff to build script. --- src/libretro/Makefile.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libretro/Makefile.common b/src/libretro/Makefile.common index e26399c7e..55e92c650 100644 --- a/src/libretro/Makefile.common +++ b/src/libretro/Makefile.common @@ -1,5 +1,5 @@ LIBRETRO_COMM_DIR = $(CORE_DIR)/../libretro-common -INCFLAGS := -I. -I$(CORE_DIR) -I$(CORE_DIR)/libretro -I$(CORE_DIR)/emucore -I$(CORE_DIR)/emucore/tia -I$(CORE_DIR)/common -I$(CORE_DIR)/common/audio -I$(CORE_DIR)/common/tv_filters +INCFLAGS := -I. -I$(CORE_DIR) -I$(CORE_DIR)/libretro -I$(CORE_DIR)/emucore -I$(CORE_DIR)/emucore/tia -I$(CORE_DIR)/common -I$(CORE_DIR)/common/audio -I$(CORE_DIR)/common/tv_filters -I$(CORE_DIR)/json ifneq (,$(findstring msvc2003,$(platform))) INCFLAGS += -I$(LIBRETRO_COMM_DIR)/include/compat/msvc