feat: initial set and sockets
This commit is contained in:
@@ -1,27 +1,30 @@
|
||||
#ifndef MYCLIB_SOCKET_H
|
||||
#define MYCLIB_SOCKET_H
|
||||
|
||||
#ifdef _WIN32
|
||||
/* Windows */
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
/* Unix */
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#endif
|
||||
|
||||
/* Run this before everything */
|
||||
int sock_platform_init();
|
||||
|
||||
/* Use this to close a socket */
|
||||
int sock_close(int socket);
|
||||
|
||||
/* Use at exit */
|
||||
int sock_platform_shutdown();
|
||||
|
||||
#endif
|
||||
#ifndef MYCLIB_SOCKET_H
|
||||
#define MYCLIB_SOCKET_H
|
||||
|
||||
#ifdef _WIN32
|
||||
/* Windows */
|
||||
#define _WIN32_WINNT 0x0600
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
/* Unix */
|
||||
#define __USE_XOPEN2K
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#endif
|
||||
|
||||
/* Run this before everything */
|
||||
int sock_platform_init();
|
||||
|
||||
/* Use this to close a socket */
|
||||
int sock_close(int socket);
|
||||
|
||||
/* Use at exit */
|
||||
int sock_platform_shutdown();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user