1 #ifndef HEADER_CURL_SETUP_WIN32_H
2 #define HEADER_CURL_SETUP_WIN32_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2020, 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.haxx.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 ***************************************************************************/
26 * Include header files for windows builds before redefining anything.
27 * Use this preprocessor block only to include or exclude windows.h,
28 * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
29 * to any other further and independent block. Under Cygwin things work
30 * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
31 * never be included when __CYGWIN__ is defined. configure script takes
32 * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
33 * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
37 # if defined(UNICODE) && !defined(_UNICODE)
40 # if defined(_UNICODE) && !defined(UNICODE)
43 # include <winerror.h>
45 # ifdef HAVE_WINSOCK2_H
46 # include <winsock2.h>
47 # ifdef HAVE_WS2TCPIP_H
48 # include <ws2tcpip.h>
51 # ifdef HAVE_WINSOCK_H
57 typedef wchar_t *(*curl_wcsdup_callback)(const wchar_t *str);
62 * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
63 * undefine USE_WINSOCK.
68 #ifdef HAVE_WINSOCK2_H
69 # define USE_WINSOCK 2
71 # ifdef HAVE_WINSOCK_H
72 # error "WinSock version 1 is no longer supported, version 2 is required!"
77 * Define _WIN32_WINNT_[OS] symbols because not all Windows build systems have
78 * those symbols to compare against, and even those that do may be missing
82 #ifndef _WIN32_WINNT_NT4
83 #define _WIN32_WINNT_NT4 0x0400 /* Windows NT 4.0 */
85 #ifndef _WIN32_WINNT_WIN2K
86 #define _WIN32_WINNT_WIN2K 0x0500 /* Windows 2000 */
88 #ifndef _WIN32_WINNT_WINXP
89 #define _WIN32_WINNT_WINXP 0x0501 /* Windows XP */
91 #ifndef _WIN32_WINNT_WS03
92 #define _WIN32_WINNT_WS03 0x0502 /* Windows Server 2003 */
94 #ifndef _WIN32_WINNT_WIN6
95 #define _WIN32_WINNT_WIN6 0x0600 /* Windows Vista */
97 #ifndef _WIN32_WINNT_VISTA
98 #define _WIN32_WINNT_VISTA 0x0600 /* Windows Vista */
100 #ifndef _WIN32_WINNT_WS08
101 #define _WIN32_WINNT_WS08 0x0600 /* Windows Server 2008 */
103 #ifndef _WIN32_WINNT_LONGHORN
104 #define _WIN32_WINNT_LONGHORN 0x0600 /* Windows Vista */
106 #ifndef _WIN32_WINNT_WIN7
107 #define _WIN32_WINNT_WIN7 0x0601 /* Windows 7 */
109 #ifndef _WIN32_WINNT_WIN8
110 #define _WIN32_WINNT_WIN8 0x0602 /* Windows 8 */
112 #ifndef _WIN32_WINNT_WINBLUE
113 #define _WIN32_WINNT_WINBLUE 0x0603 /* Windows 8.1 */
115 #ifndef _WIN32_WINNT_WINTHRESHOLD
116 #define _WIN32_WINNT_WINTHRESHOLD 0x0A00 /* Windows 10 */
118 #ifndef _WIN32_WINNT_WIN10
119 #define _WIN32_WINNT_WIN10 0x0A00 /* Windows 10 */
122 #endif /* HEADER_CURL_SETUP_WIN32_H */