summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-05-09 11:50:45 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2014-05-09 11:50:45 +0800
commitad832859a7ccd7ba44b6f97e0933ab0b413d62b6 (patch)
treec223a0233ac0add425e9643eb9cfa4e78a2c955b /include
parent8ec42bb203d48e917d8da4d925378b448416d09e (diff)
downloadsystem_core-ad832859a7ccd7ba44b6f97e0933ab0b413d62b6.zip
system_core-ad832859a7ccd7ba44b6f97e0933ab0b413d62b6.tar.gz
system_core-ad832859a7ccd7ba44b6f97e0933ab0b413d62b6.tar.bz2
Use format(gnu_printf, ...) for windows build with __USE_MINGW_ANSI_STDIO
With __USE_MINGW_ANSI_STDIO mingw compiler uses its own replacement printf*/scanf* libraries instead of Microsoft's ones which aren't always C99 compatible. Declare "archetype" of attribute format to gnu_printf because the default "printf" in mingw follows MS standard. One result is that "%z" (a gnu-extension) is accepted w/o warning by mingw compiler Change-Id: I3e92f34e2a1e8d664b4f1f55d450f7c2790671f3
Diffstat (limited to 'include')
-rw-r--r--include/android/log.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/android/log.h b/include/android/log.h
index f5b1900..ad36bd2 100644
--- a/include/android/log.h
+++ b/include/android/log.h
@@ -98,8 +98,12 @@ 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__)
+#if __USE_MINGW_ANSI_STDIO
+ __attribute__ ((format(gnu_printf, 3, 4)))
+#else
__attribute__ ((format(printf, 3, 4)))
#endif
+#endif
;
/*
@@ -117,8 +121,12 @@ void __android_log_assert(const char *cond, const char *tag,
const char *fmt, ...)
#if defined(__GNUC__)
__attribute__ ((noreturn))
+#if __USE_MINGW_ANSI_STDIO
+ __attribute__ ((format(gnu_printf, 3, 4)))
+#else
__attribute__ ((format(printf, 3, 4)))
#endif
+#endif
;
#ifdef __cplusplus