diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c2e4ba04f..61ff1860fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -404,7 +404,6 @@ if(SIZEOF_TIME_T STREQUAL "4") message(WARNING " ** Warning, this system is unable to represent times past 2038\n" " ** It will behave incorrectly when handling valid RFC5280 dates") endif() -add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T}) set(OPENSSL_LIBS ssl crypto ${PLATFORM_LIBS}) set(LIBTLS_LIBS tls ${PLATFORM_LIBS}) diff --git a/include/compat/time.h b/include/compat/time.h index 540807dd88..27485218fb 100644 --- a/include/compat/time.h +++ b/include/compat/time.h @@ -3,6 +3,14 @@ * sys/time.h compatibility shim */ +#ifndef SIZEOF_TIME_T +#ifdef SMALL_TIME_T +#define SIZEOF_TIME_T 4 +#else +#define SIZEOF_TIME_T 8 +#endif +#endif + #ifdef _MSC_VER #if _MSC_VER >= 1900 #include <../ucrt/time.h>