Version 1.8.0.0
[socat.git] / xioconfig.h
blob1c12c1ac202760bfc9e7828a5ed4f5f5cc630f1c
1 /* source: xioconfig.h */
2 /* Copyright Gerhard Rieger and contributors (see file CHANGES) */
3 /* Published under the GNU General Public License V.2, see file COPYING */
5 #ifndef __xioconfig_h_included
6 #define __xioconfig_h_included 1
8 /* ensure some dependencies between configure WITH defines. must be included
9 past config.h */
11 #if WITH_STDIO || WITH_FDNUM
12 # define WITH_FD 1
13 #endif
15 #if WITH_FILE || WITH_GOPEN || WITH_CREAT || WITH_PIPE
16 # define WITH_OPEN 1
17 #endif
19 #if WITH_OPEN || WITH_PIPE || WITH_UNIX || WITH_PTY
20 # define WITH_NAMED 1
21 #endif
23 #if WITH_TERMIOS || WITH_PTY || WITH_READLINE
24 # define _WITH_TERMIOS 1
25 #endif
27 #if WITH_SOCKS4A
28 # define WITH_SOCKS4 1
29 #endif
31 #if WITH_SOCKS4 || WITH_PROXY
32 # define WITH_TCP 1
33 # define WITH_IP4 1 /* currently this socks implementation does not work
34 with IP6 */
35 #endif
37 #if WITH_OPENSSL
38 # define WITH_TCP 1
39 # define WITH_IP4 1
40 #endif
42 #if 0
43 #if WITH_IP6
44 # if !defined(HAVE_NETINET_IP6_H)
45 # undef WITH_IP6
46 # endif
47 #endif
48 #endif
50 #if !WITH_IP4 && !WITH_IP6
51 # if WITH_TCP || WITH_UDP || WITH_SCTP || WITH_DCCP || WITH_UDPLITE || WITH_RAWIP
52 # define WITH_IP4 1
53 # endif
54 #endif
56 #if WITH_UDP || WITH_UDPLITE
57 # define _WITH_UDP 1
58 #endif
60 #if WITH_UNIX || WITH_IP4 || WITH_IP6 || WITH_SOCKS4 || WITH_RAWIP || WITH_GENERICSOCKET
61 # define _WITH_SOCKET 1
62 #else
63 # undef _WITH_SOCKET
64 #endif
66 #if !_WITH_SOCKET
67 # undef WITH_LISTEN
68 #endif
70 #if !WITH_LISTEN
71 # undef WITH_LIBWRAP
72 #endif
74 #if WITH_INTERFACE || WITH_TUN
75 # define _WITH_INTERFACE 1
76 #else
77 # define _WITH_INTERFACE 0
78 #endif
80 #if WITH_GENERICSOCKET || _WITH_INTERFACE
81 # define _WITH_SOCKET 1
82 #endif
84 #if WITH_IP4 || WITH_TUN
85 # define _WITH_IP4 1
86 #endif
88 #if WITH_IP6 || WITH_TUN
89 # define _WITH_IP6 1
90 #endif
92 #if WITH_NAMED
93 # define _WITH_NAMED 1
94 #endif
96 #if WITH_FILE
97 # define _WITH_FILE 1
98 #endif
101 #if HAVE_DEV_PTMX && HAVE_GRANTPT && HAVE_UNLOCKPT && HAVE_PROTOTYPE_LIB_ptsname
102 #else
103 # undef HAVE_DEV_PTMX
104 #endif
106 #if HAVE_DEV_PTC /* && HAVE_GRANTPT && HAVE_UNLOCKPT && HAVE_PROTOTYPE_LIB_ptsname */
107 #else
108 # undef HAVE_DEV_PTC
109 #endif
112 /* MacOS does not seem to have any pty implementation */
113 #if WITH_PTY && (HAVE_DEV_PTC || HAVE_DEV_PTMX || HAVE_OPENPTY)
114 # define HAVE_PTY 1
115 #else
116 # undef HAVE_PTY
117 #endif
119 #ifndef HAVE_TYPE_SOCKLEN
120 typedef int socklen_t;
121 #endif /* !defined(HAVE_TYPE_SOCKLEN) */
123 #ifndef HAVE_TYPE_UINT8
124 typedef unsigned char uint8_t;
125 #endif
127 #ifndef HAVE_TYPE_UINT16
128 typedef unsigned short uint16_t;
129 #endif
131 #ifndef HAVE_TYPE_UINT32
132 typedef unsigned int uint32_t;
133 #endif
135 #ifndef HAVE_TYPE_SA_FAMILY_T
136 typedef uint16_t sa_family_t;
137 #endif
139 #endif /* !defined(__xioconfig_h_included) */