diff options
author | Elliott Hughes <enh@google.com> | 2018-01-09 11:16:55 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2018-01-09 11:18:10 -0800 |
commit | 3d7fa22164cdf63ca3f88b8ddd84242fb15c9ba0 (patch) | |
tree | d112dd5b4e3038c3c568201f8d975ead6cbc1365 /base/include/android-base/stringprintf.h | |
parent | a1e27d342e05fc504ce7140463d17336c53a1af8 (diff) |
Add __attribute__((__format__)) to fastboot's die().
Also make the <android-base/stringprintf.h> macro less likely to collide.
Bug: N/A
Test: builds
Change-Id: I868a0a0002c9c53c1ec0670153df2af5f48fd969
Diffstat (limited to 'base/include/android-base/stringprintf.h')
-rw-r--r-- | base/include/android-base/stringprintf.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/base/include/android-base/stringprintf.h b/base/include/android-base/stringprintf.h index cf666abe0f..1fd6297fde 100644 --- a/base/include/android-base/stringprintf.h +++ b/base/include/android-base/stringprintf.h @@ -28,27 +28,27 @@ namespace base { // if the mingw version of vsnprintf is used, use `gnu_printf' which allows z // in %zd and PRIu64 (and related) to be recognized by the compile-time // checking. -#define FORMAT_ARCHETYPE __printf__ +#define ANDROID_BASE_FORMAT_ARCHETYPE __printf__ #ifdef __USE_MINGW_ANSI_STDIO #if __USE_MINGW_ANSI_STDIO -#undef FORMAT_ARCHETYPE -#define FORMAT_ARCHETYPE gnu_printf +#undef ANDROID_BASE_FORMAT_ARCHETYPE +#define ANDROID_BASE_FORMAT_ARCHETYPE gnu_printf #endif #endif // Returns a string corresponding to printf-like formatting of the arguments. std::string StringPrintf(const char* fmt, ...) - __attribute__((__format__(FORMAT_ARCHETYPE, 1, 2))); + __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 1, 2))); // Appends a printf-like formatting of the arguments to 'dst'. void StringAppendF(std::string* dst, const char* fmt, ...) - __attribute__((__format__(FORMAT_ARCHETYPE, 2, 3))); + __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 2, 3))); // Appends a printf-like formatting of the arguments to 'dst'. void StringAppendV(std::string* dst, const char* format, va_list ap) - __attribute__((__format__(FORMAT_ARCHETYPE, 2, 0))); + __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 2, 0))); -#undef FORMAT_ARCHETYPE +#undef ANDROID_BASE_FORMAT_ARCHETYPE } // namespace base } // namespace android |