From c3d82176295c7c1c0960b92391fa5e629d89fb51 Mon Sep 17 00:00:00 2001 From: Sak32009 Date: Sun, 1 Sep 2024 07:24:16 +0200 Subject: [PATCH 1/2] fixed msbuild warnings --- dll/local_storage.cpp | 3 ++- dll/settings_parser.cpp | 3 ++- dll/steam_user_stats_stats.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dll/local_storage.cpp b/dll/local_storage.cpp index e15da3dd..74ba6da1 100644 --- a/dll/local_storage.cpp +++ b/dll/local_storage.cpp @@ -813,7 +813,8 @@ bool Local_Storage::load_json(const std::string &full_path, nlohmann::json& json PRINT_DEBUG("Loaded json '%s' (%zu items)", full_path.c_str(), json.size()); return true; } catch (const std::exception& e) { - PRINT_DEBUG("Error while parsing '%s' json error: %s", full_path.c_str(), e.what()); + const char *errorMessage = e.what(); + PRINT_DEBUG("Error while parsing '%s' json error: %s", full_path.c_str(), errorMessage); } } else { PRINT_DEBUG("Couldn't open file '%s' to read json", full_path.c_str()); diff --git a/dll/settings_parser.cpp b/dll/settings_parser.cpp index a2f39758..31ce0323 100644 --- a/dll/settings_parser.cpp +++ b/dll/settings_parser.cpp @@ -1053,7 +1053,8 @@ static void try_parse_mods_file(class Settings *settings_client, Settings *setti PRINT_DEBUG(" workshop_item_url: '%s'", newMod.workshopItemURL.c_str()); PRINT_DEBUG(" preview_url: '%s'", newMod.previewURL.c_str()); } catch (std::exception& e) { - PRINT_DEBUG("MODLOADER ERROR: %s", e.what()); + const char *errorMessage = e.what(); + PRINT_DEBUG("MODLOADER ERROR: %s", errorMessage); } } } diff --git a/dll/steam_user_stats_stats.cpp b/dll/steam_user_stats_stats.cpp index 2aee227d..6b8a20a0 100644 --- a/dll/steam_user_stats_stats.cpp +++ b/dll/steam_user_stats_stats.cpp @@ -582,7 +582,8 @@ bool Steam_User_Stats::ResetAllStats( bool bAchievementsToo ) // this won't actually trigger a notification, just updates the data overlay->AddAchievementNotification(name, item, false); } catch(const std::exception& e) { - PRINT_DEBUG("ERROR: %s", e.what()); + const char *errorMessage = e.what(); + PRINT_DEBUG("ERROR: %s", errorMessage); } } if (needs_disk_write) save_achievements(); From b3582bf31ceb4378b79d69d03ab5a042ebbeaea0 Mon Sep 17 00:00:00 2001 From: Sak32009 Date: Sun, 1 Sep 2024 08:17:23 +0200 Subject: [PATCH 2/2] compile stb_image_resize2 as static library --- dll/local_storage.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dll/local_storage.cpp b/dll/local_storage.cpp index e15da3dd..16850038 100644 --- a/dll/local_storage.cpp +++ b/dll/local_storage.cpp @@ -17,14 +17,17 @@ #include "dll/local_storage.h" +#if defined(__WINDOWS__) +// NOTE: stb_image_write +#define STBIW_WINDOWS_UTF8 +// NOTE: stb_image +#define STBI_WINDOWS_UTF8 +#endif + #define STB_IMAGE_IMPLEMENTATION #define STB_IMAGE_STATIC #define STBI_ONLY_PNG #define STBI_ONLY_JPEG -#if defined(__WINDOWS__) -#define STBI_WINDOWS_UTF8 -#define STBIW_WINDOWS_UTF8 -#endif #include "stb/stb_image.h" #define STB_IMAGE_WRITE_IMPLEMENTATION @@ -32,6 +35,7 @@ #include "stb/stb_image_write.h" #define STB_IMAGE_RESIZE_IMPLEMENTATION +#define STB_IMAGE_RESIZE_STATIC #include "stb/stb_image_resize2.h" struct File_Data {