Skip to content

Commit

Permalink
adjust how sizeof time_t is set, the current way causes issues with M…
Browse files Browse the repository at this point in the history
…SVC 2022's preprocessor
  • Loading branch information
busterb committed Oct 29, 2023
1 parent ce79c96 commit 1fd7381
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
8 changes: 8 additions & 0 deletions include/compat/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 1fd7381

Please sign in to comment.