Add an SK_PRINTF_LIKE macro, which declares a function to have printf-like
semantics, allowing gcc and clang to check the format string against the
arguments.  Enable its use on SkString (printf, appendf, and prependf).  Also
define an SK_SIZE_T_SPECIFIER macro so there's a cross-platform way of
printing a size_t.

Review URL:  http://codereview.appspot.com/6375043/



git-svn-id: http://skia.googlecode.com/svn/trunk@4485 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index aea7982..8d52f70 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -290,6 +290,26 @@
 
 //////////////////////////////////////////////////////////////////////
 
+#ifndef SK_PRINTF_LIKE
+#if defined(__clang__) || defined(__GNUC__)
+#define SK_PRINTF_LIKE(A, B) __attribute__((format(printf, (A), (B))))
+#else
+#define SK_PRINTF_LIKE(A, B)
+#endif
+#endif
+
+//////////////////////////////////////////////////////////////////////
+
+#ifndef SK_SIZE_T_SPECIFIER
+#if defined(_MSC_VER)
+#define SK_SIZE_T_SPECIFIER "%Iu"
+#else
+#define SK_SIZE_T_SPECIFIER "%zu"
+#endif
+#endif
+
+//////////////////////////////////////////////////////////////////////
+
 #ifndef SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
 #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 1
 #endif