summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2019-06-11 18:19:20 +1000
committerShane Lontis <shane.lontis@oracle.com>2019-06-11 21:27:55 +1000
commit53f5469604b5295a93316ec75f5da6aaf299d892 (patch)
tree8d8f7166d4dc4be122cb3ac6675f2b8fc59cfe30 /apps
parenta1f0478277cedbbe5e866c046e540b48e8045a28 (diff)
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 <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8986)
Diffstat (limited to 'apps')
-rw-r--r--apps/include/opt.h3
-rw-r--r--apps/opt.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/apps/include/opt.h b/apps/include/opt.h
index ecfa06e0b4..81faf7057d 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 439f271f53..f4a4e12581 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)