From 0cddcc67ccee57b4f06d0b1c4fef70ef9d16f0a3 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Wed, 11 Jun 2014 15:36:58 -0700 Subject: [PATCH] log: Fix warning with __USE_MINGW_ANSI_STDIO I haven't seen this warning in any AOSP code, but some of our code is using this header differently than the rest of the build system, and hits this warning-turned-error: error: "__USE_MINGW_ANSI_STDIO" is not defined [-Werror=undef] Change-Id: I3c5a91f107af8bf6078e06f2ce326c5466349b79 --- include/android/log.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/android/log.h b/include/android/log.h index ad36bd223..1c171b7bf 100644 --- a/include/android/log.h +++ b/include/android/log.h @@ -98,11 +98,15 @@ int __android_log_write(int prio, const char *tag, const char *text); */ int __android_log_print(int prio, const char *tag, const char *fmt, ...) #if defined(__GNUC__) +#ifdef __USE_MINGW_ANSI_STDIO #if __USE_MINGW_ANSI_STDIO __attribute__ ((format(gnu_printf, 3, 4))) #else __attribute__ ((format(printf, 3, 4))) #endif +#else + __attribute__ ((format(printf, 3, 4))) +#endif #endif ; @@ -121,11 +125,15 @@ void __android_log_assert(const char *cond, const char *tag, const char *fmt, ...) #if defined(__GNUC__) __attribute__ ((noreturn)) +#ifdef __USE_MINGW_ANSI_STDIO #if __USE_MINGW_ANSI_STDIO __attribute__ ((format(gnu_printf, 3, 4))) #else __attribute__ ((format(printf, 3, 4))) #endif +#else + __attribute__ ((format(printf, 3, 4))) +#endif #endif ;