diff options
author | Viktor Dukhovni <openssl-users@dukhovni.org> | 2016-01-12 21:13:34 -0500 |
---|---|---|
committer | Viktor Dukhovni <openssl-users@dukhovni.org> | 2016-01-12 21:37:39 -0500 |
commit | 03f887ca1213744e2da3ec50f46d9fe3bc269510 (patch) | |
tree | 3ec7c5239598d87c71d04d076604d0d81f263efe /include | |
parent | ef30a6845a538067829deadca61b000cedf214fd (diff) | |
download | openssl-03f887ca1213744e2da3ec50f46d9fe3bc269510.tar.gz |
Maximize time_t when intmax_t is available
Well, I'm not actually changing time_t, just changing how time_t
valued opt values are converted from string to time_t.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/ossl_typ.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/openssl/ossl_typ.h b/include/openssl/ossl_typ.h index ed7c2a853c..f754136bfe 100644 --- a/include/openssl/ossl_typ.h +++ b/include/openssl/ossl_typ.h @@ -55,6 +55,8 @@ #ifndef HEADER_OPENSSL_TYPES_H # define HEADER_OPENSSL_TYPES_H +#include <limits.h> + #ifdef __cplusplus extern "C" { #endif @@ -199,6 +201,20 @@ typedef struct ocsp_req_ctx_st OCSP_REQ_CTX; typedef struct ocsp_response_st OCSP_RESPONSE; typedef struct ocsp_responder_id_st OCSP_RESPID; +#if defined(INTMAX_MAX) && defined(UINTMAX_MAX) +typedef intmax_t ossl_intmax_t; +typedef uintmax_t ossl_uintmax_t; +#else +/* + * Not long long, because the C-library can only be expected to provide + * strtoll(), strtoull() at the same time as intmax_t and strtoimax(), + * strtoumax(). Since we use these for parsing arguments, we need the + * conversion functions, not just the sizes. + */ +typedef long ossl_intmax_t; +typedef unsigned long ossl_uintmax_t; +#endif + #ifdef __cplusplus } #endif |