summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
Diffstat (limited to 'base')
-rw-r--r--base/compiler_specific.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
index cbb60a0d..c83b6b5 100644
--- a/base/compiler_specific.h
+++ b/base/compiler_specific.h
@@ -196,6 +196,18 @@
// If available, it would look like:
// __attribute__((format(wprintf, format_param, dots_param)))
+#if defined(__OBJC__)
+// Tell the compiler a function is using a +[NSString stringWithFormat:]
+// style format string. |format_param| is the one-based index of the format
+// string parameter; |dots_param| is the one-based index of the "..."
+// parameter. This should only be used when building Objective-C code.
+#if defined(COMPILER_GCC)
+#define NSSTRING_FORMAT(format_param, dots_param) \
+ __attribute__((format(__NSString__, format_param, dots_param)))
+#else
+#define NSSTRING_FORMAT(format_param, dots_param)
+#endif // defined(COMPILER_GCC)
+#endif // defined(__OBJC__)
// MemorySanitizer annotations.
#if defined(MEMORY_SANITIZER) && !defined(OS_NACL)