1 #ifndef HEADER_CURL_SETUP_H
2 #define HEADER_CURL_SETUP_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at https://curl.se/docs/copyright.html.
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
23 ***************************************************************************/
25 #if defined(BUILDING_LIBCURL) && !defined(CURL_NO_OLDIES)
26 #define CURL_NO_OLDIES
30 * Disable Visual Studio warnings:
31 * 4127 "conditional expression is constant"
34 #pragma warning(disable:4127)
38 * Define WIN32 when build target is Win32 API
41 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
47 * Don't include unneeded stuff in Windows headers to avoid compiler
48 * warnings and macro clashes.
49 * Make sure to define this macro before including any Windows headers.
51 # ifndef WIN32_LEAN_AND_MEAN
52 # define WIN32_LEAN_AND_MEAN
57 /* Detect Windows App environment which has a restricted access
58 * to the Win32 APIs. */
59 # if (defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0602)) || \
60 defined(WINAPI_FAMILY)
61 # include <winapifamily.h>
62 # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \
63 !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
64 # define CURL_WINDOWS_APP
70 * Include configuration script results or hand-crafted
71 * configuration file for platforms which lack config tool.
76 #include "curl_config.h"
78 #else /* HAVE_CONFIG_H */
81 # include "config-win32ce.h"
84 # include "config-win32.h"
88 #if defined(macintosh) && defined(__MRC__)
89 # include "config-mac.h"
93 # include "config-riscos.h"
97 # include "config-amigaos.h"
101 # include "config-os400.h"
105 # include "config-plan9.h"
108 #endif /* HAVE_CONFIG_H */
110 #if defined(_MSC_VER)
111 # pragma warning(push,1)
114 /* ================================================================ */
115 /* Definition of preprocessor macros/symbols which modify compiler */
116 /* behavior or generated code characteristics must be done here, */
117 /* as appropriate, before any system header file is included. It is */
118 /* also possible to have them defined in the config file included */
119 /* before this point. As a result of all this we frown inclusion of */
120 /* system header files in our config files, avoid this at any cost. */
121 /* ================================================================ */
124 * AIX 4.3 and newer needs _THREAD_SAFE defined to build
125 * proper reentrant code. Others may also need it.
128 #ifdef NEED_THREAD_SAFE
129 # ifndef _THREAD_SAFE
130 # define _THREAD_SAFE
135 * Tru64 needs _REENTRANT set for a few function prototypes and
136 * things to appear in the system header files. Unixware needs it
137 * to build proper reentrant code. Others may also need it.
140 #ifdef NEED_REENTRANT
146 /* Solaris needs this to get a POSIX-conformant getpwuid_r */
147 #if defined(sun) || defined(__sun)
148 # ifndef _POSIX_PTHREAD_SEMANTICS
149 # define _POSIX_PTHREAD_SEMANTICS 1
153 /* ================================================================ */
154 /* If you need to include a system header file for your platform, */
155 /* please, do it beyond the point further indicated in this file. */
156 /* ================================================================ */
158 #include <curl/curl.h>
161 * Disable other protocols when http is the only one desired.
165 # ifndef CURL_DISABLE_DICT
166 # define CURL_DISABLE_DICT
168 # ifndef CURL_DISABLE_FILE
169 # define CURL_DISABLE_FILE
171 # ifndef CURL_DISABLE_FTP
172 # define CURL_DISABLE_FTP
174 # ifndef CURL_DISABLE_GOPHER
175 # define CURL_DISABLE_GOPHER
177 # ifndef CURL_DISABLE_IMAP
178 # define CURL_DISABLE_IMAP
180 # ifndef CURL_DISABLE_LDAP
181 # define CURL_DISABLE_LDAP
183 # ifndef CURL_DISABLE_LDAPS
184 # define CURL_DISABLE_LDAPS
186 # ifndef CURL_DISABLE_MQTT
187 # define CURL_DISABLE_MQTT
189 # ifndef CURL_DISABLE_POP3
190 # define CURL_DISABLE_POP3
192 # ifndef CURL_DISABLE_RTSP
193 # define CURL_DISABLE_RTSP
195 # ifndef CURL_DISABLE_SMB
196 # define CURL_DISABLE_SMB
198 # ifndef CURL_DISABLE_SMTP
199 # define CURL_DISABLE_SMTP
201 # ifndef CURL_DISABLE_TELNET
202 # define CURL_DISABLE_TELNET
204 # ifndef CURL_DISABLE_TFTP
205 # define CURL_DISABLE_TFTP
210 * When http is disabled rtsp is not supported.
213 #if defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_RTSP)
214 # define CURL_DISABLE_RTSP
217 /* ================================================================ */
218 /* No system header file shall be included in this file before this */
219 /* point. The only allowed ones are those included from curl/system.h */
220 /* ================================================================ */
223 * OS/400 setup file includes some system headers.
227 # include "setup-os400.h"
231 * VMS setup file includes some system headers.
235 # include "setup-vms.h"
239 * Windows setup file includes some system headers.
242 #ifdef HAVE_WINDOWS_H
243 # include "setup-win32.h"
247 * Use getaddrinfo to resolve the IPv4 address literal. If the current network
248 * interface doesn't support IPv4, but supports IPv6, NAT64, and DNS64,
249 * performing this task will result in a synthesized IPv6 address.
251 #if defined(__APPLE__) && !defined(USE_ARES)
252 #include <TargetConditionals.h>
253 #define USE_RESOLVE_ON_IPS 1
254 # if defined(TARGET_OS_OSX) && TARGET_OS_OSX
255 # define CURL_OSX_CALL_COPYPROXIES 1
260 # include <lwip/init.h>
261 # include <lwip/sockets.h>
262 # include <lwip/netdb.h>
265 #ifdef HAVE_EXTRA_STRICMP_H
266 # include <extra/stricmp.h>
269 #ifdef HAVE_EXTRA_STRDUP_H
270 # include <extra/strdup.h>
274 # include <exec/types.h>
275 # include <exec/execbase.h>
276 # include <proto/exec.h>
277 # include <proto/dos.h>
279 # ifdef HAVE_PROTO_BSDSOCKET_H
280 # include <proto/bsdsocket.h> /* ensure bsdsocket.library use */
281 # define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
284 * In clib2 arpa/inet.h warns that some prototypes may clash
285 * with bsdsocket.library. This avoids the definition of those.
287 # define __NO_NET_API
295 #ifdef __TANDEM /* for nsr-tandem-nsk systems */
299 #ifndef STDC_HEADERS /* no standard C headers! */
300 #include <curl/stdcheaders.h>
304 # include <sys/types.h>
306 # define sys_nerr EILSEQ
310 * Salford-C kludge section (mostly borrowed from wxWidgets).
313 #pragma suppress 353 /* Possible nested comments */
314 #pragma suppress 593 /* Define not used */
315 #pragma suppress 61 /* enum has no name */
316 #pragma suppress 106 /* unnamed, unused parameter */
320 /* Default Windows file API selection. */
322 # if defined(_MSC_VER) && (_INTEGRAL_MAX_BITS >= 64)
323 # define USE_WIN32_LARGE_FILES
324 # elif defined(__MINGW32__)
325 # define USE_WIN32_LARGE_FILES
327 # define USE_WIN32_SMALL_FILES
332 * Large file (>2Gb) support using WIN32 functions.
335 #ifdef USE_WIN32_LARGE_FILES
337 # include <sys/types.h>
338 # include <sys/stat.h>
340 # define lseek(fdes,offset,whence) _lseeki64(fdes, offset, whence)
342 # define fstat(fdes,stp) _fstati64(fdes, stp)
344 # define stat(fname,stp) curlx_win32_stat(fname, stp)
345 # define struct_stat struct _stati64
346 # define LSEEK_ERROR (__int64)-1
347 # define open curlx_win32_open
348 # define fopen(fname,mode) curlx_win32_fopen(fname, mode)
349 # define access(fname,mode) curlx_win32_access(fname, mode)
350 int curlx_win32_open(const char *filename, int oflag, ...);
351 int curlx_win32_stat(const char *path, struct_stat *buffer);
352 FILE *curlx_win32_fopen(const char *filename, const char *mode);
353 int curlx_win32_access(const char *path, int mode);
357 * Small file (<2Gb) support using WIN32 functions.
360 #ifdef USE_WIN32_SMALL_FILES
362 # include <sys/types.h>
363 # include <sys/stat.h>
366 # define lseek(fdes,offset,whence) _lseek(fdes, (long)offset, whence)
367 # define fstat(fdes,stp) _fstat(fdes, stp)
368 # define stat(fname,stp) curlx_win32_stat(fname, stp)
369 # define struct_stat struct _stat
370 # define open curlx_win32_open
371 # define fopen(fname,mode) curlx_win32_fopen(fname, mode)
372 # define access(fname,mode) curlx_win32_access(fname, mode)
373 int curlx_win32_stat(const char *path, struct_stat *buffer);
374 int curlx_win32_open(const char *filename, int oflag, ...);
375 FILE *curlx_win32_fopen(const char *filename, const char *mode);
376 int curlx_win32_access(const char *path, int mode);
378 # define LSEEK_ERROR (long)-1
382 # define struct_stat struct stat
386 # define LSEEK_ERROR (off_t)-1
389 #ifndef SIZEOF_TIME_T
390 /* assume default size of time_t to be 32 bit */
391 #define SIZEOF_TIME_T 4
395 * Default sizeof(off_t) in case it hasn't been defined in config file.
399 # if defined(__VMS) && !defined(__VAX)
400 # if defined(_LARGEFILE)
401 # define SIZEOF_OFF_T 8
403 # elif defined(__OS400__) && defined(__ILEC400__)
404 # if defined(_LARGE_FILES)
405 # define SIZEOF_OFF_T 8
407 # elif defined(__MVS__) && defined(__IBMC__)
408 # if defined(_LP64) || defined(_LARGE_FILES)
409 # define SIZEOF_OFF_T 8
411 # elif defined(__370__) && defined(__IBMC__)
412 # if defined(_LP64) || defined(_LARGE_FILES)
413 # define SIZEOF_OFF_T 8
416 # ifndef SIZEOF_OFF_T
417 # define SIZEOF_OFF_T 4
421 #if (SIZEOF_CURL_OFF_T == 4)
422 # define CURL_OFF_T_MAX CURL_OFF_T_C(0x7FFFFFFF)
424 /* assume SIZEOF_CURL_OFF_T == 8 */
425 # define CURL_OFF_T_MAX CURL_OFF_T_C(0x7FFFFFFFFFFFFFFF)
427 #define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - CURL_OFF_T_C(1))
429 #if (SIZEOF_TIME_T == 4)
430 # ifdef HAVE_TIME_T_UNSIGNED
431 # define TIME_T_MAX UINT_MAX
432 # define TIME_T_MIN 0
434 # define TIME_T_MAX INT_MAX
435 # define TIME_T_MIN INT_MIN
438 # ifdef HAVE_TIME_T_UNSIGNED
439 # define TIME_T_MAX 0xFFFFFFFFFFFFFFFF
440 # define TIME_T_MIN 0
442 # define TIME_T_MAX 0x7FFFFFFFFFFFFFFF
443 # define TIME_T_MIN (-TIME_T_MAX - 1)
448 /* some limits.h headers have this defined, some don't */
449 #if defined(SIZEOF_SIZE_T) && (SIZEOF_SIZE_T > 4)
450 #define SIZE_T_MAX 18446744073709551615U
452 #define SIZE_T_MAX 4294967295U
457 /* some limits.h headers have this defined, some don't */
458 #if defined(SIZEOF_SIZE_T) && (SIZEOF_SIZE_T > 4)
459 #define SSIZE_T_MAX 9223372036854775807
461 #define SSIZE_T_MAX 2147483647
466 * Arg 2 type for gethostname in case it hasn't been defined in config file.
469 #ifndef GETHOSTNAME_TYPE_ARG2
471 # define GETHOSTNAME_TYPE_ARG2 int
473 # define GETHOSTNAME_TYPE_ARG2 size_t
477 /* Below we define some functions. They should
479 4. set the SIGALRM signal timeout
480 5. set dir/file naming defines
485 # define DIR_CHAR "\\"
489 # ifdef MSDOS /* Watt-32 */
491 # include <sys/ioctl.h>
492 # define select(n,r,w,x,t) select_s(n,r,w,x,t)
493 # define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z))
505 /* Minix 3 versions up to at least 3.1.3 are missing these prototypes */
506 extern char *strtok_r(char *s, const char *delim, char **last);
507 extern struct tm *gmtime_r(const time_t * const timep, struct tm *tmp);
510 # define DIR_CHAR "/"
512 # ifndef fileno /* sunos 4 have this as a macro! */
513 int fileno(FILE *stream);
519 * msvc 6.0 requires PSDK in order to have INET6_ADDRSTRLEN
520 * defined in ws2tcpip.h as well as to provide IPv6 support.
521 * Does not apply if lwIP is used.
524 #if defined(_MSC_VER) && !defined(__POCC__) && !defined(USE_LWIPSOCK)
525 # if !defined(HAVE_WS2TCPIP_H) || \
526 ((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN))
527 # undef HAVE_GETADDRINFO_THREADSAFE
528 # undef HAVE_FREEADDRINFO
529 # undef HAVE_GETADDRINFO
534 /* ---------------------------------------------------------------- */
535 /* resolver specialty compile-time defines */
536 /* CURLRES_* defines to use in the host*.c sources */
537 /* ---------------------------------------------------------------- */
540 * lcc-win32 doesn't have _beginthreadex(), lacks threads support.
543 #if defined(__LCC__) && defined(WIN32)
544 # undef USE_THREADS_POSIX
545 # undef USE_THREADS_WIN32
549 * MSVC threads support requires a multi-threaded runtime library.
550 * _beginthreadex() is not available in single-threaded ones.
553 #if defined(_MSC_VER) && !defined(__POCC__) && !defined(_MT)
554 # undef USE_THREADS_POSIX
555 # undef USE_THREADS_WIN32
559 * Mutually exclusive CURLRES_* definitions.
562 #if defined(ENABLE_IPV6) && defined(HAVE_GETADDRINFO)
563 # define CURLRES_IPV6
565 # define CURLRES_IPV4
569 # define CURLRES_ASYNCH
570 # define CURLRES_ARES
571 /* now undef the stock libc functions just to avoid them being used */
572 # undef HAVE_GETADDRINFO
573 # undef HAVE_FREEADDRINFO
574 # undef HAVE_GETHOSTBYNAME
575 #elif defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)
576 # define CURLRES_ASYNCH
577 # define CURLRES_THREADED
579 # define CURLRES_SYNCH
582 /* ---------------------------------------------------------------- */
585 * msvc 6.0 does not have struct sockaddr_storage and
586 * does not define IPPROTO_ESP in winsock2.h. But both
587 * are available if PSDK is properly installed.
590 #if defined(_MSC_VER) && !defined(__POCC__)
591 # if !defined(HAVE_WINSOCK2_H) || ((_MSC_VER < 1300) && !defined(IPPROTO_ESP))
592 # undef HAVE_STRUCT_SOCKADDR_STORAGE
597 * Intentionally fail to build when using msvc 6.0 without PSDK installed.
598 * The brave of heart can circumvent this, defining ALLOW_MSVC6_WITHOUT_PSDK
599 * in lib/config-win32.h although absolutely discouraged and unsupported.
602 #if defined(_MSC_VER) && !defined(__POCC__)
603 # if !defined(HAVE_WINDOWS_H) || ((_MSC_VER < 1300) && !defined(_FILETIME_))
604 # if !defined(ALLOW_MSVC6_WITHOUT_PSDK)
605 # error MSVC 6.0 requires "February 2003 Platform SDK" a.k.a. \
606 "Windows Server 2003 PSDK"
608 # define CURL_DISABLE_LDAP 1
613 #if defined(HAVE_LIBIDN2) && defined(HAVE_IDN2_H) && !defined(USE_WIN32_IDN)
614 /* The lib and header are present */
618 #if defined(USE_LIBIDN2) && defined(USE_WIN32_IDN)
619 #error "Both libidn2 and WinIDN are enabled, choose one."
622 #define LIBIDN_REQUIRED_VERSION "0.4.1"
624 #if defined(USE_GNUTLS) || defined(USE_OPENSSL) || defined(USE_NSS) || \
625 defined(USE_MBEDTLS) || \
626 defined(USE_WOLFSSL) || defined(USE_SCHANNEL) || \
627 defined(USE_SECTRANSP) || defined(USE_GSKIT) || \
628 defined(USE_BEARSSL) || defined(USE_RUSTLS)
629 #define USE_SSL /* SSL support has been enabled */
632 /* Single point where USE_SPNEGO definition might be defined */
633 #if !defined(CURL_DISABLE_CRYPTO_AUTH) && \
634 (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
638 /* Single point where USE_KERBEROS5 definition might be defined */
639 #if !defined(CURL_DISABLE_CRYPTO_AUTH) && \
640 (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
641 #define USE_KERBEROS5
644 /* Single point where USE_NTLM definition might be defined */
645 #if !defined(CURL_DISABLE_CRYPTO_AUTH) && !defined(CURL_DISABLE_NTLM)
646 # if defined(USE_OPENSSL) || defined(USE_MBEDTLS) || \
647 defined(USE_GNUTLS) || defined(USE_NSS) || defined(USE_SECTRANSP) || \
648 defined(USE_OS400CRYPTO) || defined(USE_WIN32_CRYPTO) || \
649 (defined(USE_WOLFSSL) && defined(HAVE_WOLFSSL_DES_ECB_ENCRYPT))
650 # define USE_CURL_NTLM_CORE
652 # if defined(USE_CURL_NTLM_CORE) || defined(USE_WINDOWS_SSPI)
657 #ifdef CURL_WANTS_CA_BUNDLE_ENV
658 #error "No longer supported. Set CURLOPT_CAINFO at runtime instead."
661 #if defined(USE_LIBSSH2) || defined(USE_LIBSSH) || defined(USE_WOLFSSH)
666 * Provide a mechanism to silence picky compilers, such as gcc 4.6+.
667 * Parameters should of course normally not be unused, but for example when
668 * we have multiple implementations of the same interface it may happen.
671 #if defined(__GNUC__) && ((__GNUC__ >= 3) || \
672 ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7)))
673 # define UNUSED_PARAM __attribute__((__unused__))
674 # define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
676 # define UNUSED_PARAM /*NOTHING*/
677 # define WARN_UNUSED_RESULT
681 * Include macros and defines that should only be processed once.
684 #ifndef HEADER_CURL_SETUP_ONCE_H
685 #include "curl_setup_once.h"
689 * Definition of our NOP statement Object-like macro
692 #ifndef Curl_nop_stmt
693 # define Curl_nop_stmt do { } while(0)
697 * Ensure that Winsock and lwIP TCP/IP stacks are not mixed.
700 #if defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H)
701 # if defined(SOCKET) || \
702 defined(USE_WINSOCK) || \
703 defined(HAVE_WINSOCK2_H) || \
704 defined(HAVE_WS2TCPIP_H)
705 # error "WinSock and lwIP TCP/IP stack definitions shall not coexist!"
710 * shutdown() flags for systems that don't define them
722 #define SHUT_RDWR 0x02
725 /* Define S_ISREG if not defined by system headers, f.e. MSVC */
726 #if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)
727 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
730 /* Define S_ISDIR if not defined by system headers, f.e. MSVC */
731 #if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR)
732 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
735 /* In Windows the default file mode is text but an application can override it.
736 Therefore we specify it explicitly. https://github.com/curl/curl/pull/258
738 #if defined(WIN32) || defined(MSDOS)
739 #define FOPEN_READTEXT "rt"
740 #define FOPEN_WRITETEXT "wt"
741 #define FOPEN_APPENDTEXT "at"
742 #elif defined(__CYGWIN__)
743 /* Cygwin has specific behavior we need to address when WIN32 is not defined.
744 https://cygwin.com/cygwin-ug-net/using-textbinary.html
745 For write we want our output to have line endings of LF and be compatible with
746 other Cygwin utilities. For read we want to handle input that may have line
747 endings either CRLF or LF so 't' is appropriate.
749 #define FOPEN_READTEXT "rt"
750 #define FOPEN_WRITETEXT "w"
751 #define FOPEN_APPENDTEXT "a"
753 #define FOPEN_READTEXT "r"
754 #define FOPEN_WRITETEXT "w"
755 #define FOPEN_APPENDTEXT "a"
758 /* WinSock destroys recv() buffer when send() failed.
759 * Enabled automatically for Windows and for Cygwin as Cygwin sockets are
760 * wrappers for WinSock sockets. https://github.com/curl/curl/issues/657
761 * Define DONT_USE_RECV_BEFORE_SEND_WORKAROUND to force disable workaround.
763 #if !defined(DONT_USE_RECV_BEFORE_SEND_WORKAROUND)
764 # if defined(WIN32) || defined(__CYGWIN__)
765 # define USE_RECV_BEFORE_SEND_WORKAROUND
767 #else /* DONT_USE_RECV_BEFORE_SEND_WORKAROUND */
768 # ifdef USE_RECV_BEFORE_SEND_WORKAROUND
769 # undef USE_RECV_BEFORE_SEND_WORKAROUND
771 #endif /* DONT_USE_RECV_BEFORE_SEND_WORKAROUND */
773 /* for systems that don't detect this in configure */
774 #ifndef CURL_SA_FAMILY_T
775 # if defined(HAVE_SA_FAMILY_T)
776 # define CURL_SA_FAMILY_T sa_family_t
777 # elif defined(HAVE_ADDRESS_FAMILY)
778 # define CURL_SA_FAMILY_T ADDRESS_FAMILY
780 /* use a sensible default */
781 # define CURL_SA_FAMILY_T unsigned short
785 /* Some convenience macros to get the larger/smaller value out of two given.
786 We prefix with CURL to prevent name collisions. */
787 #define CURLMAX(x,y) ((x)>(y)?(x):(y))
788 #define CURLMIN(x,y) ((x)<(y)?(x):(y))
790 /* A convenience macro to provide both the string literal and the length of
791 the string literal in one go, useful for functions that take "string,len"
793 #define STRCONST(x) x,sizeof(x)-1
795 /* Some versions of the Android SDK is missing the declaration */
796 #if defined(HAVE_GETPWUID_R) && defined(HAVE_DECL_GETPWUID_R_MISSING)
798 int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf,
799 size_t buflen, struct passwd **result);
805 #define UNITTEST static
808 #if defined(USE_NGHTTP2) || defined(USE_HYPER)
812 #if defined(USE_NGTCP2) || defined(USE_QUICHE) || defined(USE_MSH3)
816 #if defined(USE_UNIX_SOCKETS) && defined(WIN32)
817 # if defined(__MINGW32__) && !defined(LUP_SECURE)
818 typedef u_short ADDRESS_FAMILY; /* Classic mingw, 11y+ old mingw-w64 */
820 # if !defined(UNIX_PATH_MAX)
821 /* Replicating logic present in afunix.h
822 (distributed with newer Windows 10 SDK versions only) */
823 # define UNIX_PATH_MAX 108
824 /* !checksrc! disable TYPEDEFSTRUCT 1 */
825 typedef struct sockaddr_un {
826 ADDRESS_FAMILY sun_family;
827 char sun_path[UNIX_PATH_MAX];
828 } SOCKADDR_UN, *PSOCKADDR_UN;
829 # define WIN32_SOCKADDR_UN
833 #endif /* HEADER_CURL_SETUP_H */