Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined(_WIN32)
- #ifndef _WIN32_WINNT
- #define _WIN32_WINNT 0x0A00
- #endif
- #include <Windows.h>
- #include <iphlpapi.h>
- #include <ws2tcpip.h>
- #include <winsock2.h>
- #pragma comment(lib, "ws2_32.lib")
- #pragma comment(lib, "iphlpapi.lib")
- #define ISVALIDSOCKET(s) ((s) != INVALID_SOCKET)
- #define CLOSESOCKET(s) closesocket(s)
- #define GETSOCKETERRNO() (WSAGetLastError())
- #else
- #include <unistd.h>
- #include <errno.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/select.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <netdb.h>
- #define ISVALIDSOCKET(s) ((s) >= 0)
- #define CLOSESOCKET(s) close(s)
- #define GETSOCKETERRNO() (errno)
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement