From c4bb6b79ea36c05ccfe3033174a7950ac6a51609 Mon Sep 17 00:00:00 2001 From: Pierre Wendling Date: Tue, 12 Sep 2023 18:33:46 +0200 Subject: MSVC: Enable building ocspcheck. - Add `STDIN_FILENO` to compat unistd header. - Use quotes to include compat getopt header in the compat unistd. - Export additional symbols needed by ocspcheck (optarg, optind, ftruncate) --- include/compat/unistd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/compat/unistd.h b/include/compat/unistd.h index 2583a6e..63c07fc 100644 --- a/include/compat/unistd.h +++ b/include/compat/unistd.h @@ -23,6 +23,7 @@ ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset); #include #include +#define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 @@ -65,7 +66,7 @@ int getentropy(void *buf, size_t buflen); #endif #ifndef HAVE_GETOPT -#include +#include "getopt.h" #endif #ifndef HAVE_GETPAGESIZE -- cgit v1.2.3-55-g6feb From 1fd73818df53ae51adb681a34b2d5bca4bb37e49 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sun, 15 Oct 2023 19:05:29 -0500 Subject: adjust how sizeof time_t is set, the current way causes issues with MSVC 2022's preprocessor --- CMakeLists.txt | 1 - include/compat/time.h | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c2e4ba..61ff186 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 540807d..2748521 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> -- cgit v1.2.3-55-g6feb