Provide a cross-platform format specifier (OSSLzu) for printing size_t
authorMatt Caswell <matt@openssl.org>
Tue, 25 Oct 2016 14:28:30 +0000 (15:28 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 26 Oct 2016 20:03:29 +0000 (21:03 +0100)
Reviewed-by: Richard Levitte <levitte@openssl.org>
include/openssl/e_os2.h

index 99ea3477d7b42903c5c5a2c79446c49d258f36fb..5bec684dca36b639b52b2e2e3987ef9c16b2178b 100644 (file)
@@ -276,6 +276,17 @@ typedef unsigned __int64 uint64_t;
 #  endif
 # endif
 
+/* Format specifier for printing size_t */
+# if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
+#  define OSSLzu  "zu"
+# else
+#  ifdef THIRTY_TWO_BIT
+#   define OSSLzu "u"
+#  else
+#   define OSSLzu PRIu64
+#  endif
+# endif
+
 /* ossl_inline: portable inline definition usable in public headers */
 # if !defined(inline) && !defined(__cplusplus)
 #  if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L