Fix app opt compile failure due to missing <inttypes.h>
authorShane Lontis <shane.lontis@oracle.com>
Tue, 11 Jun 2019 08:19:20 +0000 (18:19 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Tue, 11 Jun 2019 11:27:55 +0000 (21:27 +1000)
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 <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8986)

apps/include/opt.h
apps/opt.c

index ecfa06e0b4dbb6c4453593549d17ed35b9b2238b..81faf7057d53b8080a489b5383c134fee9d193d5 100644 (file)
@@ -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
index 439f271f537d134bed3c184249e3dfc44f5cc709..f4a4e125818e056ac616d879cb95ffb6adbcafc9 100644 (file)
@@ -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)