Lely core libraries 2.3.4
io.h
Go to the documentation of this file.
1
21#ifndef LELY_IO_INTERN_IO_H_
22#define LELY_IO_INTERN_IO_H_
23
24#ifdef HAVE_CONFIG_H
25#include <config.h>
26#endif
27
28#include <lely/io/io.h>
29
30#if _WIN32
31#ifdef _MSC_VER
32#pragma comment(lib, "ws2_32.lib")
33#endif
34#define FD_SETSIZE 1024
35// clang-format off
36#include <winsock2.h>
37#include <ws2bth.h>
38#include <ws2tcpip.h>
39#include <mstcpip.h>
40// clang-format on
41#elif defined(_POSIX_C_SOURCE)
42#include <arpa/inet.h>
43#include <fcntl.h>
44#include <net/if.h>
45#include <netinet/in.h>
46#include <netinet/tcp.h>
47#include <sys/socket.h>
48#include <sys/stat.h>
49#include <sys/un.h>
50#include <termios.h>
51#include <unistd.h>
52#endif
53
54#ifdef __linux__
55
56#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
57#include <bluetooth/bluetooth.h>
58#endif
59#ifdef HAVE_BLUETOOTH_RFCOMM_H
60#include <bluetooth/rfcomm.h>
61#endif
62
63#ifdef HAVE_LINUX_CAN_H
64#include <linux/can.h>
65#endif
66
67#ifdef HAVE_SYS_IOCTL_H
68#include <sys/ioctl.h>
69#endif
70
71#endif
72
73#if _WIN32
74
75#ifndef MCAST_JOIN_GROUP
76#define MCAST_JOIN_GROUP 41
77#endif
78
79#ifndef MCAST_LEAVE_GROUP
80#define MCAST_LEAVE_GROUP 42
81#endif
82
83#ifndef MCAST_BLOCK_SOURCE
84#define MCAST_BLOCK_SOURCE 43
85#endif
86
87#ifndef MCAST_UNBLOCK_SOURCE
88#define MCAST_UNBLOCK_SOURCE 44
89#endif
90
91#ifndef MCAST_JOIN_SOURCE_GROUP
92#define MCAST_JOIN_SOURCE_GROUP 45
93#endif
94
95#ifndef MCAST_LEAVE_SOURCE_GROUP
96#define MCAST_LEAVE_SOURCE_GROUP 46
97#endif
98
99typedef USHORT sa_family_t;
100
101#else
102
103typedef int HANDLE;
104#define INVALID_HANDLE_VALUE (-1)
105
106typedef int SOCKET;
107#define INVALID_SOCKET (-1)
108
109#define SOCKET_ERROR (-1)
110
111#define closesocket close
112
113#endif // _WIN32
114
115#endif // !LELY_IO_INTERN_IO_H_
This header file is part of the utilities library; it contains the configuration functions.
This header file is part of the I/O library; it contains the CAN bus declarations for Linux.
This is the public header file of the I/O library.
This header file is part of the C11 and POSIX compatibility library; it includes <unistd....