2
* Herein lies a set of private ugly portability
3
* hacks for the mind-numbingly broken Unix like
4
* things that exist out there.
11
#ifdef HAVE_WINSOCK2_H
12
# include <winsock2.h>
14
# ifdef HAVE_SYS_SOCKET_H
15
# include <sys/socket.h>
17
# ifdef HAVE_NETINET_IN_H
18
# include <netinet/in.h>
23
# ifdef HAVE_NETINET_TCP_H
24
# include <netinet/tcp.h>
29
# ifdef HAVE_ARPA_INET_H
30
# include <arpa/inet.h>
32
# ifdef HAVE_ARPA_NAMESER_H
33
# include <arpa/nameser.h>
52
# ifdef HAVE_SYS_UTIME_H
53
# include <sys/utime.h>
59
#ifdef HAVE_LINUX_IRDA_H
60
# include <asm/types.h>
61
# include <linux/irda.h>
64
#ifndef MAXHOSTNAMELEN
65
# define MAXHOSTNAMELEN 255
68
#ifdef HAVE_WINSOCK2_H
69
/* Define fake errno values for socket stuff. These aren't defined
70
* in the Microsoft C library. Use the WSAE* error codes as such,
71
* as they don't overlap with errno values. Define only those that
72
* actually are used by the linc2 code.
75
# define ECONNREFUSED WSAECONNREFUSED
78
# define EADDRINUSE WSAEADDRINUSE
81
# define EINPROGRESS WSAEINPROGRESS
84
/* Undefine address families that aren't really present, as the
85
* linc code checks for these macros being defined when it
86
* determines whether they are supported. (It would be more correct
87
* to check at run-time.)
89
# undef AF_UNIX /* No Unix domain sockets */
90
# undef AF_INET6 /* Doesn't have sockaddr_in6 */
94
#if !defined (NI_MAXSERV) || !defined (NI_MAXHOST)
95
# include <sys/param.h>
98
#if !defined (NI_MAXHOST)
99
# define NI_MAXHOST MAXHOSTNAMELEN
102
#if !defined (NI_MAXSERV)
103
# define NI_MAXSERV 64
106
#if !defined (INADDR_NONE)
107
# define INADDR_NONE (-1)
110
#if !defined (UNIX_PATH_MAX)
111
/* UNP: 14.2 - Posix.1g at least 100 bytes */
112
# define LINK_UNIX_PATH_MAX 100
114
# define LINK_UNIX_PATH_MAX UNIX_PATH_MAX
117
const char *link_strerror (int);
119
#endif /* LINK_HACKS_H */