From 0496280c4589bf33192ab01ce052d66179e0ade3 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 2 Oct 2025 07:53:27 +0100 Subject: Further mingw-w64/gcc build tweaks Commit 6481bb22b (win32: use 64-bit time on 32-bit platforms) fails to build with mingw32-gcc prior to mingw-w64 10.0.0. Don't used 64-bit time for such builds. mingw-w64 7.0.0 and below don't have some definitions required for native TLS support. This is enabled by default in the 64-bit Unicode build. Add the definitions required for the default build. TLS 1.3 support needs more but isn't enabled by default. (GitHub issue #527) --- include/mingw.h | 2 +- networking/tls.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/mingw.h b/include/mingw.h index 276e40659..debd22ef2 100644 --- a/include/mingw.h +++ b/include/mingw.h @@ -3,7 +3,7 @@ #define IMPL(name,ret,retval,...) static inline ret name(__VA_ARGS__) { return retval; } /* Use 64-bit time on 32-bit platforms. */ -#if !defined(_WIN64) +#if !defined(_WIN64) && __MINGW64_VERSION_MAJOR >= 10 # define time_t __time64_t # define ctime(t) _ctime64(t) # define localtime(t) _localtime64(t) diff --git a/networking/tls.c b/networking/tls.c index ba8ebfe82..97217f435 100644 --- a/networking/tls.c +++ b/networking/tls.c @@ -2378,6 +2378,13 @@ void FAST_FUNC tls_run_copy_loop(tls_state_t *tls, unsigned flags) # define SECBUFFER_ALERT 17 #endif +#ifndef SP_PROT_TLS1_0_CLIENT +# define SP_PROT_TLS1_0_CLIENT 0x00000080 +# define SP_PROT_TLS1_1_CLIENT 0x00000200 +# define SP_PROT_TLS1_2_CLIENT 0x00000800 +# define SCH_USE_STRONG_CRYPTO 0x00400000 +#endif + #define BB_SCHANNEL_ISC_FLAGS \ (ISC_REQ_ALLOCATE_MEMORY | ISC_REQ_CONFIDENTIALITY | ISC_REQ_INTEGRITY | ISC_REQ_REPLAY_DETECT | \ ISC_REQ_SEQUENCE_DETECT | ISC_REQ_STREAM | ISC_REQ_USE_SUPPLIED_CREDS) -- cgit v1.2.3-55-g6feb