From 43708c1545c1ba71984bdc6e5ec47de65002d2fd Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Mon, 27 Mar 2017 16:49:29 -0400 Subject: [PATCH] Move PRIu64, OSSLzu to e_os.h Those macros are private, not public. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/3044) --- e_os.h | 26 ++++++++++++++++++++++++++ include/openssl/e_os2.h | 23 ----------------------- test/build.info | 2 +- test/ssltestlib.c | 1 + 4 files changed, 28 insertions(+), 24 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) diff --git a/include/openssl/e_os2.h b/include/openssl/e_os2.h index 7960d86f84..c1a9ad7c25 100644 --- a/include/openssl/e_os2.h +++ b/include/openssl/e_os2.h @@ -258,29 +258,6 @@ typedef unsigned __int64 uint64_t; # include # 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. - */ -# 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 - /* ossl_inline: portable inline definition usable in public headers */ # if !defined(inline) && !defined(__cplusplus) # if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L diff --git a/test/build.info b/test/build.info index 8c760f494c..2e7737f928 100644 --- a/test/build.info +++ b/test/build.info @@ -253,7 +253,7 @@ IF[{- !$disabled{tests} -}] INCLUDE[testutil.o]=.. INCLUDE[ssl_test_ctx.o]=../include INCLUDE[handshake_helper.o]=../include - INCLUDE[ssltestlib.o]=../include + INCLUDE[ssltestlib.o]=.. ../include SOURCE[x509aux]=x509aux.c INCLUDE[x509aux]=../include diff --git a/test/ssltestlib.c b/test/ssltestlib.c index 64aa9169b6..6fce12e0fc 100644 --- a/test/ssltestlib.c +++ b/test/ssltestlib.c @@ -9,6 +9,7 @@ #include +#include "e_os.h" #include "ssltestlib.h" static int tls_dump_new(BIO *bi); -- 2.25.1