/* librist. Copyright © 2019 SipRadius LLC. All right reserved. * Author: Kuldeep Singh Dhaka * Author: Sergio Ammirata, Ph.D. */ #ifndef __SOCKET_SHIM_H #define __SOCKET_SHIM_H #ifndef SOL_IP #define SOL_IP 0x0 #define SOL_IPV6 0x29 #endif #ifdef _WIN32 /* librist uses WSAPoll/inet_pton/inet_ntop which mingw-w64 gates on * _WIN32_WINNT >= 0x0600. Force a Vista minimum before * is pulled in, so downstream consumers that set a lower baseline * (e.g. VLC 3.0 contribs pin it to XP SP2 via 0x0502) still compile. */ #if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600 # undef _WIN32_WINNT # define _WIN32_WINNT 0x0600 #endif #include #define _WINSOCKAPI_ #include #include #include #define AF_LOCAL AF_UNSPEC #define MSG_DONTWAIT (0) typedef int socklen_t; #ifndef __MINGW32__ #include #define dup(s) _dup(s) #define write(fd, buf, size) _write(fd, buf, size) #endif #ifndef SHUT_RDWR #define SHUT_RDWR SD_BOTH #endif #else /* Unix like OSes */ #include #include #include #include #include #include #include #include #include #endif #endif