quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

setup-win32.h (4102B)


      1 #ifndef HEADER_CURL_SETUP_WIN32_H
      2 #define HEADER_CURL_SETUP_WIN32_H
      3 /***************************************************************************
      4  *                                  _   _ ____  _
      5  *  Project                     ___| | | |  _ \| |
      6  *                             / __| | | | |_) | |
      7  *                            | (__| |_| |  _ <| |___
      8  *                             \___|\___/|_| \_\_____|
      9  *
     10  * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
     11  *
     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.
     15  *
     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.
     19  *
     20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
     21  * KIND, either express or implied.
     22  *
     23  * SPDX-License-Identifier: curl
     24  *
     25  ***************************************************************************/
     26 
     27 #undef USE_WINSOCK
     28 /* ---------------------------------------------------------------- */
     29 /*                     Watt-32 TCP/IP SPECIFIC                      */
     30 /* ---------------------------------------------------------------- */
     31 #ifdef USE_WATT32
     32 #  include <tcp.h>
     33 #  include <sys/socket.h>
     34 #  undef byte
     35 #  undef word
     36 #  define HAVE_SYS_IOCTL_H
     37 #  define HAVE_NETINET_IN_H
     38 #  define HAVE_NETDB_H
     39 #  define HAVE_ARPA_INET_H
     40 #  define SOCKET int
     41 /* ---------------------------------------------------------------- */
     42 /*               BSD-style lwIP TCP/IP stack SPECIFIC               */
     43 /* ---------------------------------------------------------------- */
     44 #elif defined(USE_LWIPSOCK)
     45   /* Define to use BSD-style lwIP TCP/IP stack. */
     46   /* #define USE_LWIPSOCK 1 */
     47 #  undef HAVE_GETHOSTNAME
     48 #  undef LWIP_POSIX_SOCKETS_IO_NAMES
     49 #  undef RECV_TYPE_ARG1
     50 #  undef RECV_TYPE_ARG3
     51 #  undef SEND_TYPE_ARG1
     52 #  undef SEND_TYPE_ARG3
     53 #  define HAVE_GETHOSTBYNAME_R
     54 #  define HAVE_GETHOSTBYNAME_R_6
     55 #  define LWIP_POSIX_SOCKETS_IO_NAMES 0
     56 #  define RECV_TYPE_ARG1 int
     57 #  define RECV_TYPE_ARG3 size_t
     58 #  define SEND_TYPE_ARG1 int
     59 #  define SEND_TYPE_ARG3 size_t
     60 #elif defined(_WIN32)
     61 #  define USE_WINSOCK 2
     62 #endif
     63 
     64 /*
     65  * Include header files for Windows builds before redefining anything.
     66  * Use this preprocessor block only to include or exclude windows.h,
     67  * winsock2.h or ws2tcpip.h. Any other Windows thing belongs
     68  * to any other further and independent block. Under Cygwin things work
     69  * just as under Linux (e.g. <sys/socket.h>) and the Winsock headers should
     70  * never be included when __CYGWIN__ is defined.
     71  */
     72 
     73 #ifdef _WIN32
     74 #  if defined(UNICODE) && !defined(_UNICODE)
     75 #    error "UNICODE is defined but _UNICODE is not defined"
     76 #  endif
     77 #  if defined(_UNICODE) && !defined(UNICODE)
     78 #    error "_UNICODE is defined but UNICODE is not defined"
     79 #  endif
     80 #  include <winsock2.h>
     81 #  include <ws2tcpip.h>
     82 #  include <windows.h>
     83 #  include <winerror.h>
     84 #  include <tchar.h>
     85 #endif
     86 
     87 /*
     88  * Define _WIN32_WINNT_[OS] symbols because not all Windows build systems have
     89  * those symbols to compare against, and even those that do may be missing
     90  * newer symbols.
     91  */
     92 
     93 #ifndef _WIN32_WINNT_WINXP
     94 #define _WIN32_WINNT_WINXP          0x0501   /* Windows XP */
     95 #endif
     96 #ifndef _WIN32_WINNT_WS03
     97 #define _WIN32_WINNT_WS03           0x0502   /* Windows Server 2003 */
     98 #endif
     99 #ifndef _WIN32_WINNT_VISTA
    100 #define _WIN32_WINNT_VISTA          0x0600   /* Windows Vista */
    101 #endif
    102 #ifndef _WIN32_WINNT_WS08
    103 #define _WIN32_WINNT_WS08           0x0600   /* Windows Server 2008 */
    104 #endif
    105 #ifndef _WIN32_WINNT_WIN7
    106 #define _WIN32_WINNT_WIN7           0x0601   /* Windows 7 */
    107 #endif
    108 #ifndef _WIN32_WINNT_WIN8
    109 #define _WIN32_WINNT_WIN8           0x0602   /* Windows 8 */
    110 #endif
    111 #ifndef _WIN32_WINNT_WINBLUE
    112 #define _WIN32_WINNT_WINBLUE        0x0603   /* Windows 8.1 */
    113 #endif
    114 #ifndef _WIN32_WINNT_WIN10
    115 #define _WIN32_WINNT_WIN10          0x0A00   /* Windows 10 */
    116 #endif
    117 
    118 #endif /* HEADER_CURL_SETUP_WIN32_H */