RT3984: Fix clang compiler warning on Mac OS X where %ld is used for uint64_t.
[openssl.git] / include / openssl / e_os2.h
index 177b0981e387962c00e1fdecc2fc9fd36f4a10e3..9f7dcf16199da0c6b5671f96fb79b48d57f95eae 100644 (file)
@@ -294,6 +294,22 @@ typedef unsigned __int64 uint64_t;
 #  include <stdint.h>
 # endif
 
+/*
+ * We need a format operator for some client tools for uint64_t.
+ * This is an attempt at doing so in a portable manner.
+ * If we can't use a built-in definition, we'll revert to the previous
+ * behavior that was hard-coded but now causing compiler warnings on
+ * some systems (e.g. Mac OS X).
+ */
+# ifndef PRIu64
+#  if (__STDC_VERSION__ >= 199901L)
+#   include <inttypes.h>
+#  endif
+#  ifndef PRIu64
+#   define PRIu64 "lu"
+#  endif
+# endif
+
 #ifdef  __cplusplus
 }
 #endif