[Scummvm-git-logs] scummvm master -> b0832788ecfb4d99fc21f08888da3ee7aa4066b1
lephilousophe
lephilousophe at users.noreply.github.com
Sun Jul 4 20:13:11 UTC 2021
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:
b0832788ec SDL: build fix for various non-x86 architectures
Commit: b0832788ecfb4d99fc21f08888da3ee7aa4066b1
https://github.com/scummvm/scummvm/commit/b0832788ecfb4d99fc21f08888da3ee7aa4066b1
Author: Christian Krause (chkr at plauener.de)
Date: 2021-07-04T22:13:09+02:00
Commit Message:
SDL: build fix for various non-x86 architectures
- allow certain symbols from unistd.h within SDL backend
- e.g. on armv7, ppc64, aarch and s390, SDL.h would include indirectly
unistd.h after common/forbidden.h and so the preprocessor would
generate broken code even if the symbols are never called by
scummvm
Changed paths:
backends/platform/sdl/sdl-sys.h
diff --git a/backends/platform/sdl/sdl-sys.h b/backends/platform/sdl/sdl-sys.h
index 219aca830a..d33f1453ee 100644
--- a/backends/platform/sdl/sdl-sys.h
+++ b/backends/platform/sdl/sdl-sys.h
@@ -111,6 +111,32 @@
#endif // FORBIDDEN_SYMBOL_EXCEPTION_time_h
+// Fix compilation on non-x86 architectures
+// It needs various (usually forbidden) symbols from unistd.h
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
+
+ #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_chdir)
+ #undef chdir
+ #define chdir FAKE_chdir
+ #endif
+
+ #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_getcwd)
+ #undef getcwd
+ #define getcwd FAKE_getcwd
+ #endif
+
+ #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_getwd)
+ #undef getwd
+ #define getwd FAKE_getwd
+ #endif
+
+ #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_unlink)
+ #undef unlink
+ #define unlink FAKE_unlink
+ #endif
+
+#endif // FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
+
// HACK: SDL might include windows.h which defines its own ARRAYSIZE.
// However, we want to use the version from common/util.h. Thus, we make sure
// that we actually have this definition after including the SDL headers.
@@ -274,4 +300,29 @@
#endif // FORBIDDEN_SYMBOL_EXCEPTION_time_h
+// re-forbid all those unistd.h symbols again (if they were forbidden)
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
+
+ #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_chdir)
+ #undef chdir
+ #define chdir(a) FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
+ #endif
+
+ #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_getcwd)
+ #undef getcwd
+ #define getcwd(a,b) FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
+ #endif
+
+ #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_getwd)
+ #undef getwd
+ #define getwd(a) FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
+ #endif
+
+ #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_unlink)
+ #undef unlink
+ #define unlink(a) FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
+ #endif
+
+#endif // FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
+
#endif
More information about the Scummvm-git-logs
mailing list