summaryrefslogtreecommitdiffstats
path: root/e_os.h
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2017-03-27 16:49:29 -0400
committerRich Salz <rsalz@openssl.org>2017-03-28 08:43:48 -0400
commit43708c1545c1ba71984bdc6e5ec47de65002d2fd (patch)
tree7aa29d868810d5cfd4c4bae9dbbed7833933d3ad /e_os.h
parent9ff79fa3e12628d4c0c32b5de82a9c2b20fe7402 (diff)
Move PRIu64, OSSLzu to e_os.h
Those macros are private, not public. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3044)
Diffstat (limited to 'e_os.h')
-rw-r--r--e_os.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/e_os.h b/e_os.h
index d2f4d3ff28..f255aa9c22 100644
--- a/e_os.h
+++ b/e_os.h
@@ -29,6 +29,32 @@ extern "C" {
# endif
# endif
+/*
+ * We need a format operator for some client tools for uint64_t. If inttypes.h
+ * isn't available or did not define it, just go with hard-coded.
+ */
+# if defined(OPENSSL_SYS_UEFI)
+# define PRIu64 "Lu"
+# endif
+# ifndef PRIu64
+# ifdef SIXTY_FOUR_BIT_LONG
+# define PRIu64 "lu"
+# else
+# define PRIu64 "llu"
+# 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
+
# if !defined(NDEBUG) && !defined(OPENSSL_NO_STDIO)
# define REF_ASSERT_ISNT(test) \
(void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)