aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Wendling <pierre.wendling.4@gmail.com>2023-09-12 18:33:46 +0200
committerBrent Cook <busterb@gmail.com>2023-10-29 12:28:44 -0500
commitc4bb6b79ea36c05ccfe3033174a7950ac6a51609 (patch)
treee15ea4ac82cba82224f493c04b9259f53d93b107
parent80489416222831efbfa3d0e2c74e39bfddb2dcb8 (diff)
downloadportable-c4bb6b79ea36c05ccfe3033174a7950ac6a51609.tar.gz
portable-c4bb6b79ea36c05ccfe3033174a7950ac6a51609.tar.bz2
portable-c4bb6b79ea36c05ccfe3033174a7950ac6a51609.zip
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)
-rw-r--r--apps/ocspcheck/CMakeLists.txt4
-rw-r--r--crypto/CMakeLists.txt2
-rw-r--r--include/compat/unistd.h3
-rw-r--r--tls/CMakeLists.txt2
4 files changed, 6 insertions, 5 deletions
diff --git a/apps/ocspcheck/CMakeLists.txt b/apps/ocspcheck/CMakeLists.txt
index 43eebdf..9cf7a8b 100644
--- a/apps/ocspcheck/CMakeLists.txt
+++ b/apps/ocspcheck/CMakeLists.txt
@@ -1,5 +1,3 @@
1if(NOT MSVC)
2
3set( 1set(
4 OCSPCHECK_SRC 2 OCSPCHECK_SRC
5 http.c 3 http.c
@@ -33,5 +31,3 @@ if(ENABLE_LIBRESSL_INSTALL)
33 install(FILES ocspcheck.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8) 31 install(FILES ocspcheck.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
34 32
35endif(ENABLE_LIBRESSL_INSTALL) 33endif(ENABLE_LIBRESSL_INSTALL)
36
37endif()
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index 6ff46c8..d61e607 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -778,6 +778,8 @@ endif()
778if(NOT HAVE_GETOPT) 778if(NOT HAVE_GETOPT)
779 set(CRYPTO_SRC ${CRYPTO_SRC} compat/getopt_long.c) 779 set(CRYPTO_SRC ${CRYPTO_SRC} compat/getopt_long.c)
780 set(EXTRA_EXPORT ${EXTRA_EXPORT} getopt) 780 set(EXTRA_EXPORT ${EXTRA_EXPORT} getopt)
781 set(EXTRA_EXPORT ${EXTRA_EXPORT} optarg)
782 set(EXTRA_EXPORT ${EXTRA_EXPORT} optind)
781endif() 783endif()
782 784
783if(NOT HAVE_GETPAGESIZE) 785if(NOT HAVE_GETPAGESIZE)
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);
23#include <io.h> 23#include <io.h>
24#include <process.h> 24#include <process.h>
25 25
26#define STDIN_FILENO 0
26#define STDOUT_FILENO 1 27#define STDOUT_FILENO 1
27#define STDERR_FILENO 2 28#define STDERR_FILENO 2
28 29
@@ -65,7 +66,7 @@ int getentropy(void *buf, size_t buflen);
65#endif 66#endif
66 67
67#ifndef HAVE_GETOPT 68#ifndef HAVE_GETOPT
68#include <getopt.h> 69#include "getopt.h"
69#endif 70#endif
70 71
71#ifndef HAVE_GETPAGESIZE 72#ifndef HAVE_GETPAGESIZE
diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt
index 59deee3..4beef36 100644
--- a/tls/CMakeLists.txt
+++ b/tls/CMakeLists.txt
@@ -22,6 +22,8 @@ if(WIN32)
22 compat/pread.c 22 compat/pread.c
23 compat/pwrite.c 23 compat/pwrite.c
24 ) 24 )
25
26 set(LIBTLS_EXTRA_EXPORT ${LIBTLS_EXTRA_EXPORT} ftruncate)
25endif() 27endif()
26 28
27if(NOT "${OPENSSLDIR}" STREQUAL "") 29if(NOT "${OPENSSLDIR}" STREQUAL "")