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)
This commit is contained in:
Pierre Wendling 2023-09-12 18:33:46 +02:00 committed by Brent Cook
parent 8048941622
commit c4bb6b79ea
4 changed files with 6 additions and 5 deletions

View File

@ -1,5 +1,3 @@
if(NOT MSVC)
set( set(
OCSPCHECK_SRC OCSPCHECK_SRC
http.c http.c
@ -33,5 +31,3 @@ if(ENABLE_LIBRESSL_INSTALL)
install(FILES ocspcheck.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8) install(FILES ocspcheck.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
endif(ENABLE_LIBRESSL_INSTALL) endif(ENABLE_LIBRESSL_INSTALL)
endif()

View File

@ -778,6 +778,8 @@ endif()
if(NOT HAVE_GETOPT) if(NOT HAVE_GETOPT)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/getopt_long.c) set(CRYPTO_SRC ${CRYPTO_SRC} compat/getopt_long.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} getopt) set(EXTRA_EXPORT ${EXTRA_EXPORT} getopt)
set(EXTRA_EXPORT ${EXTRA_EXPORT} optarg)
set(EXTRA_EXPORT ${EXTRA_EXPORT} optind)
endif() endif()
if(NOT HAVE_GETPAGESIZE) if(NOT HAVE_GETPAGESIZE)

View File

@ -23,6 +23,7 @@ ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset);
#include <io.h> #include <io.h>
#include <process.h> #include <process.h>
#define STDIN_FILENO 0
#define STDOUT_FILENO 1 #define STDOUT_FILENO 1
#define STDERR_FILENO 2 #define STDERR_FILENO 2
@ -65,7 +66,7 @@ int getentropy(void *buf, size_t buflen);
#endif #endif
#ifndef HAVE_GETOPT #ifndef HAVE_GETOPT
#include <getopt.h> #include "getopt.h"
#endif #endif
#ifndef HAVE_GETPAGESIZE #ifndef HAVE_GETPAGESIZE

View File

@ -22,6 +22,8 @@ if(WIN32)
compat/pread.c compat/pread.c
compat/pwrite.c compat/pwrite.c
) )
set(LIBTLS_EXTRA_EXPORT ${LIBTLS_EXTRA_EXPORT} ftruncate)
endif() endif()
if(NOT "${OPENSSLDIR}" STREQUAL "") if(NOT "${OPENSSLDIR}" STREQUAL "")