From 03f887ca1213744e2da3ec50f46d9fe3bc269510 Mon Sep 17 00:00:00 2001 From: Viktor Dukhovni Date: Tue, 12 Jan 2016 21:13:34 -0500 Subject: 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 --- include/openssl/ossl_typ.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') 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 + #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 -- cgit v1.2.3