-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.hpp.in
More file actions
45 lines (38 loc) · 898 Bytes
/
common.hpp.in
File metadata and controls
45 lines (38 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef HTTPWEBSERVER_SOCKET_COMMON_HPP__
#define HTTPWEBSERVER_SOCKET_COMMON_HPP__
#include <string>
#include <vector>
#include <iostream>
// #include "interfaces/socket.hpp"
#cmakedefine LINUX
#cmakedefine LOSE
#cmakedefine BANANA
#cmakedefine HTTP_WEB_SERVER_SOCKET_DEBUG
#ifdef LOSE
# include <winsock2.h>
# include <ws2tcpip.h>
# include <io.h>
#
# define HOST_NAME_MAX 256
#elif defined(LINUX)
# include <sys/types.h>
# include <sys/stat.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <arpa/inet.h>
# include <netdb.h>
# include <unistd.h>
# include <errno.h>
# include <limits.h>
# include <unistd.h>
#
# define SOCKET int
# define SOCKET_ERROR -1
# define INVALID_SOCKET -1
#endif
#include <fcntl.h>
#ifndef MAX_INPUT
# define MAX_INPUT 256
#endif
#define SOCKET_NOERROR 0
#endif /* HTTPWEBSERVER_SOCKET_COMMON_HPP__ */