Edit

kc3-lang/libxml2/include/wsockcompat.h

Branch :

  • Show log

    Commit

  • Author : Nick Wellnhofer
    Date : 2022-09-05 02:02:54
    Hash : 30c8d9bb
    Message : http: Simplify IPv6 checks This should also enable IPv6 support on Windows. Untested and mostly useless anyway, since we don't support HTTPS.

  • include/wsockcompat.h
  • /* include/wsockcompat.h
     * Windows -> Berkeley Sockets compatibility things.
     */
    
    #if !defined __XML_WSOCKCOMPAT_H__
    #define __XML_WSOCKCOMPAT_H__
    
    #include <errno.h>
    #include <winsock2.h>
    
    /* Fix for old MinGW. */
    #ifndef _WINSOCKAPI_
    #define _WINSOCKAPI_
    #endif
    
    /* the following is a workaround a problem for 'inline' keyword in said
       header when compiled with Borland C++ 6 */
    #if defined(__BORLANDC__) && !defined(__cplusplus)
    #define inline __inline
    #define _inline __inline
    #endif
    
    #include <ws2tcpip.h>
    
    /* Check if ws2tcpip.h is a recent version which provides getaddrinfo() */
    #if defined(GetAddrInfo)
    #include <wspiapi.h>
    #ifndef SUPPORT_IP6
      #define SUPPORT_IP6
    #endif
    #endif
    
    #ifndef XML_SOCKLEN_T
    #define XML_SOCKLEN_T int
    #endif
    
    #ifndef ECONNRESET
    #define ECONNRESET WSAECONNRESET
    #endif
    #ifndef EINPROGRESS
    #define EINPROGRESS WSAEINPROGRESS
    #endif
    #ifndef EINTR
    #define EINTR WSAEINTR
    #endif
    #ifndef ESHUTDOWN
    #define ESHUTDOWN WSAESHUTDOWN
    #endif
    #ifndef EWOULDBLOCK
    #define EWOULDBLOCK WSAEWOULDBLOCK
    #endif
    
    #endif /* __XML_WSOCKCOMPAT_H__ */