The branch master has been updated via 53f5469604b5295a93316ec75f5da6aaf299d892 (commit) via a1f0478277cedbbe5e866c046e540b48e8045a28 (commit) via 92bec78a26139185c840a5d516a2aa171b20e269 (commit) from f0efeea29eca6e528a976f62ae2422eee34ea0eb (commit)
- Log ----------------------------------------------------------------- commit 53f5469604b5295a93316ec75f5da6aaf299d892 Author: Shane Lontis <shane.lon...@oracle.com> Date: Tue Jun 11 18:19:20 2019 +1000 Fix app opt compile failure due to missing <inttypes.h> opt.c uses functions that are only available if inttypes.h exists. It now checks a define which is unavailable if inttypes.h is included. The include is done automagically inside e_os2.h. Reviewed-by: Richard Levitte <levi...@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8986) commit a1f0478277cedbbe5e866c046e540b48e8045a28 Author: Shane Lontis <shane.lon...@oracle.com> Date: Tue Jun 11 18:17:52 2019 +1000 Fix Windows Compile failure due to missing <inttypes.h> Including <inttypes.h> caused a windows build failure. The test is now skipped if strtoimax & strtoumax are not supported. It does this by checking for a define which is only available if inttypes.h is not included. The include is done automagically inside e_os2.h. Reviewed-by: Richard Levitte <levi...@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8986) commit 92bec78a26139185c840a5d516a2aa171b20e269 Author: Shane Lontis <shane.lon...@oracle.com> Date: Tue Jun 11 18:16:51 2019 +1000 Add defines to indicate if intypes.h and stdint.h are unavailable Use the defines OPENSSL_NO_INTTYPES_H & OPENSSL_NO_STDINT_H to determine if the headers are unavailable for a platform. Reviewed-by: Richard Levitte <levi...@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8986) ----------------------------------------------------------------------- Summary of changes: apps/include/opt.h | 3 ++- apps/opt.c | 3 ++- include/openssl/e_os2.h | 6 ++++++ test/params_conversion_test.c | 15 +++++++++++---- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/apps/include/opt.h b/apps/include/opt.h index ecfa06e..81faf70 100644 --- a/apps/include/opt.h +++ b/apps/include/opt.h @@ -317,7 +317,8 @@ int opt_int(const char *arg, int *result); int opt_ulong(const char *arg, unsigned long *result); int opt_long(const char *arg, long *result); #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \ - defined(INTMAX_MAX) && defined(UINTMAX_MAX) + defined(INTMAX_MAX) && defined(UINTMAX_MAX) && \ + !defined(OPENSSL_NO_INTTYPES_H) int opt_imax(const char *arg, intmax_t *result); int opt_umax(const char *arg, uintmax_t *result); #else diff --git a/apps/opt.c b/apps/opt.c index 439f271..f4a4e12 100644 --- a/apps/opt.c +++ b/apps/opt.c @@ -377,7 +377,8 @@ int opt_long(const char *value, long *result) } #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \ - defined(INTMAX_MAX) && defined(UINTMAX_MAX) + defined(INTMAX_MAX) && defined(UINTMAX_MAX) && \ + !defined(OPENSSL_NO_INTTYPES_H) /* Parse an intmax_t, put it into *result; return 0 on failure, else 1. */ int opt_imax(const char *value, intmax_t *result) diff --git a/include/openssl/e_os2.h b/include/openssl/e_os2.h index b88abc1..50ce937 100644 --- a/include/openssl/e_os2.h +++ b/include/openssl/e_os2.h @@ -228,6 +228,8 @@ extern "C" { # endif /* Standard integer types */ +# define OPENSSL_NO_INTTYPES_H +# define OPENSSL_NO_STDINT_H # if defined(OPENSSL_SYS_UEFI) typedef INT8 int8_t; typedef UINT8 uint8_t; @@ -241,6 +243,9 @@ typedef UINT64 uint64_t; defined(__osf__) || defined(__sgi) || defined(__hpux) || \ defined(OPENSSL_SYS_VMS) || defined (__OpenBSD__) # include <inttypes.h> +# undef OPENSSL_NO_INTTYPES_H +/* Because the specs say that inttypes.h includes stdint.h if present */ +# undef OPENSSL_NO_STDINT_H # elif defined(_MSC_VER) && _MSC_VER<=1500 /* * minimally required typdefs for systems not supporting inttypes.h or @@ -256,6 +261,7 @@ typedef __int64 int64_t; typedef unsigned __int64 uint64_t; # else # include <stdint.h> +# undef OPENSSL_NO_STDINT_H # endif /* ossl_inline: portable inline definition usable in public headers */ diff --git a/test/params_conversion_test.c b/test/params_conversion_test.c index 96d0aaa..9db5bd8 100644 --- a/test/params_conversion_test.c +++ b/test/params_conversion_test.c @@ -9,13 +9,15 @@ */ #include <string.h> -#include <inttypes.h> #include <openssl/params.h> #include "testutil.h" -#ifdef OPENSSL_SYS_WINDOWS -# define strcasecmp _stricmp -#endif +/* On machines that dont support <inttypes.h> just disable the tests */ +#if !defined(OPENSSL_NO_INTTYPES_H) + +# ifdef OPENSSL_SYS_WINDOWS +# define strcasecmp _stricmp +# endif typedef struct { const OSSL_PARAM *param; @@ -320,6 +322,8 @@ end: return res; } +#endif /* OPENSSL_NO_INTTYPES_H */ + OPT_TEST_DECLARE_USAGE("file...\n") int setup_tests(void) @@ -329,6 +333,9 @@ int setup_tests(void) if (n == 0) return 0; +#if !defined(OPENSSL_NO_INTTYPES_H) ADD_ALL_TESTS(run_param_file_tests, n); +#endif /* OPENSSL_NO_INTTYPES_H */ + return 1; }