From a50c36d1381be2e7d0748a2c734e41357fd4920f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 3 May 2011 14:29:01 +0200 Subject: [PATCH] ANDROID: Fix various forbidden symbol clashes --- backends/platform/android/android.cpp | 14 ++++++++++++++ backends/platform/android/events.cpp | 17 +++++++++++++++++ backends/platform/android/gfx.cpp | 17 +++++++++++++++++ backends/platform/android/jni.cpp | 17 +++++++++++++++++ backends/platform/android/texture.cpp | 17 +++++++++++++++++ 5 files changed, 82 insertions(+) diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index 7cf1e988fc8..b1d0727d1fa 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -28,6 +28,20 @@ // Allow use of stuff in #define FORBIDDEN_SYMBOL_EXCEPTION_time_h +// Disable printf override in common/forbidden.h to avoid +// clashes with log.h from the Android SDK. +// That header file uses +// __attribute__ ((format(printf, 3, 4))) +// which gets messed up by our override mechanism; this could +// be avoided by either changing the Android SDK to use the equally +// legal and valid +// __attribute__ ((format(printf, 3, 4))) +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the Android port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf + #include #include #include diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp index 09466b4d2fc..2f140f0c0b5 100644 --- a/backends/platform/android/events.cpp +++ b/backends/platform/android/events.cpp @@ -25,6 +25,23 @@ #if defined(__ANDROID__) +// Allow use of stuff in +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + +// Disable printf override in common/forbidden.h to avoid +// clashes with log.h from the Android SDK. +// That header file uses +// __attribute__ ((format(printf, 3, 4))) +// which gets messed up by our override mechanism; this could +// be avoided by either changing the Android SDK to use the equally +// legal and valid +// __attribute__ ((format(printf, 3, 4))) +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the Android port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf + #include "common/events.h" #include "backends/platform/android/android.h" diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index fae428d29f1..ebce58e291c 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -25,6 +25,23 @@ #if defined(__ANDROID__) +// Allow use of stuff in +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + +// Disable printf override in common/forbidden.h to avoid +// clashes with log.h from the Android SDK. +// That header file uses +// __attribute__ ((format(printf, 3, 4))) +// which gets messed up by our override mechanism; this could +// be avoided by either changing the Android SDK to use the equally +// legal and valid +// __attribute__ ((format(printf, 3, 4))) +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the Android port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf + #include "common/endian.h" #include "graphics/conversion.h" diff --git a/backends/platform/android/jni.cpp b/backends/platform/android/jni.cpp index f23d71b2a48..13aef11fa2d 100644 --- a/backends/platform/android/jni.cpp +++ b/backends/platform/android/jni.cpp @@ -25,6 +25,23 @@ #if defined(__ANDROID__) +// Allow use of stuff in +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + +// Disable printf override in common/forbidden.h to avoid +// clashes with log.h from the Android SDK. +// That header file uses +// __attribute__ ((format(printf, 3, 4))) +// which gets messed up by our override mechanism; this could +// be avoided by either changing the Android SDK to use the equally +// legal and valid +// __attribute__ ((format(printf, 3, 4))) +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the Android port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf + #include "base/main.h" #include "base/version.h" #include "common/config-manager.h" diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp index 2d737833099..c830676c071 100644 --- a/backends/platform/android/texture.cpp +++ b/backends/platform/android/texture.cpp @@ -25,6 +25,23 @@ #if defined(__ANDROID__) +// Allow use of stuff in +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + +// Disable printf override in common/forbidden.h to avoid +// clashes with log.h from the Android SDK. +// That header file uses +// __attribute__ ((format(printf, 3, 4))) +// which gets messed up by our override mechanism; this could +// be avoided by either changing the Android SDK to use the equally +// legal and valid +// __attribute__ ((format(printf, 3, 4))) +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the Android port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf + #include "base/main.h" #include "graphics/surface.h"