[Scummvm-git-logs] scummvm master -> b548bcfa287f234dac10ad513109ff99e772ab6e
digitall
noreply at scummvm.org
Wed Mar 16 09:15:38 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b548bcfa28 AGS: Fix Undefined Macro Compiler Warnings
Commit: b548bcfa287f234dac10ad513109ff99e772ab6e
https://github.com/scummvm/scummvm/commit/b548bcfa287f234dac10ad513109ff99e772ab6e
Author: D G Turner (digitall at scummvm.org)
Date: 2022-03-16T09:13:02Z
Commit Message:
AGS: Fix Undefined Macro Compiler Warnings
These are emitted by GCC when -Wundef is passed.
The AGS_PLATFORM_DEFINES_PSP_VARS may have previously caused those variables
to be present since undefined macros are assumed to be 0, thus the test would
have passed.
Changed paths:
engines/ags/ags.cpp
engines/ags/engine/main/main.cpp
engines/ags/globals.h
engines/ags/shared/font/ttf_font_renderer.cpp
engines/ags/shared/util/string.h
diff --git a/engines/ags/ags.cpp b/engines/ags/ags.cpp
index 9c2237126bc..f09d9ed12c0 100644
--- a/engines/ags/ags.cpp
+++ b/engines/ags/ags.cpp
@@ -34,7 +34,6 @@
#include "engines/util.h"
#include "ags/shared/core/platform.h"
-#define AGS_PLATFORM_DEFINES_PSP_VARS (AGS_PLATFORM_OS_IOS || AGS_PLATFORM_OS_ANDROID)
#include "ags/lib/std/set.h"
#include "ags/shared/ac/common.h"
diff --git a/engines/ags/engine/main/main.cpp b/engines/ags/engine/main/main.cpp
index adcf1e88934..c96f0097982 100644
--- a/engines/ags/engine/main/main.cpp
+++ b/engines/ags/engine/main/main.cpp
@@ -20,7 +20,6 @@
*/
#include "ags/shared/core/platform.h"
-#define AGS_PLATFORM_DEFINES_PSP_VARS (AGS_PLATFORM_OS_IOS || AGS_PLATFORM_OS_ANDROID)
#include "ags/lib/std/set.h"
#include "ags/lib/allegro.h" // allegro_exit
#include "ags/shared/ac/common.h"
diff --git a/engines/ags/globals.h b/engines/ags/globals.h
index 545a011b04a..15cde98d733 100644
--- a/engines/ags/globals.h
+++ b/engines/ags/globals.h
@@ -22,6 +22,9 @@
#ifndef AGS_GLOBALS_H
#define AGS_GLOBALS_H
+#include "ags/shared/core/platform.h"
+#define AGS_PLATFORM_DEFINES_PSP_VARS (AGS_PLATFORM_OS_IOS || AGS_PLATFORM_OS_ANDROID)
+
#include "ags/shared/ac/game_version.h"
#include "ags/shared/util/stdio_compat.h"
#include "ags/shared/util/string.h"
@@ -1074,7 +1077,7 @@ public:
int _psp_ignore_acsetup_cfg_file = 0;
int _psp_clear_cache_on_room_change = 0; // clear --sprite cache-- when room is unloaded
-#if AGS_PLATFORM_SCUMMVM
+#if defined(AGS_PLATFORM_SCUMMVM) && AGS_PLATFORM_SCUMMVM
int _psp_audio_cachesize = 10;
#endif
const char *_psp_game_file_name = "";
diff --git a/engines/ags/shared/font/ttf_font_renderer.cpp b/engines/ags/shared/font/ttf_font_renderer.cpp
index 982af7e67fa..c5638219ae1 100644
--- a/engines/ags/shared/font/ttf_font_renderer.cpp
+++ b/engines/ags/shared/font/ttf_font_renderer.cpp
@@ -105,7 +105,7 @@ bool TTFFontRenderer::LoadFromDiskEx(int fontNumber, int fontSize,
}
// TODO: move this somewhere, should not be right here
-#if AGS_OUTLINE_FONT_FIX
+#if defined(AGS_OUTLINE_FONT_FIX) && AGS_OUTLINE_FONT_FIX
// FIXME: (!!!) this fix should be done differently:
// 1. Find out which OUTLINE font was causing troubles;
// 2. Replace outline method ONLY if that troublesome font is used as outline.
diff --git a/engines/ags/shared/util/string.h b/engines/ags/shared/util/string.h
index f31c4849b76..a969aae7097 100644
--- a/engines/ags/shared/util/string.h
+++ b/engines/ags/shared/util/string.h
@@ -92,7 +92,7 @@ public:
bool IsNullOrSpace() const;
// Those getters are for tests only, hence if AGS_PLATFORM_DEBUG
-#if AGS_PLATFORM_TEST
+#if defined(AGS_PLATFORM_TEST) && AGS_PLATFORM_TEST
inline const char *GetBuffer() const {
return _buf;
}
More information about the Scummvm-git-logs
mailing list