MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
config_static.h
1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* Consider this file as an extension to config.h, just that it contains
3  * static text. The intention is to reduce the number of #ifdefs in the rest
4  * of the source files without having to put all of them in AH_BOTTOM
5  * in configure.ac.
6  */
7 #ifndef CONFIG_STATIC_H
8 #define CONFIG_STATIC_H 1
9 
10 #ifdef WIN32
11 #define SOCKETPAIR_AF AF_INET
12 #define get_socket_error() WSAGetLastError()
13 extern void initialize_sockets(void);
14 #else
15 #define closesocket(a) close(a)
16 #define SOCKET int
17 #define SOCKETPAIR_AF AF_UNIX
18 #define SOCKET_ERROR -1
19 #define INVALID_SOCKET -1
20 #define get_socket_error() errno
21 #define initialize_sockets()
22 #endif
23 
24 #define HAVE_NETDB_H 1
25 #define HAVE_NETINET_TCP_H 1
26 #define HAVE_NETINET_IN_H 1
27 #define HAVE_SIGIGNORE 1
28 
29 #ifdef HAVE_DLFCN_H
30 #include <dlfcn.h>
31 #endif
32 
33 #ifdef HAVE_LINK_H
34 #include <link.h>
35 #endif
36 
37 #ifdef HAVE_STDBOOL_H
38 #include <stdbool.h>
39 #else
40 #ifndef bool
41 #define bool char
42 #define false 0
43 #define true 1
44 #endif
45 #endif
46 
47 #ifdef HAVE_INTTYPES_H
48 #include <inttypes.h>
49 #endif
50 
51 #ifdef HAVE_SYSEXITS_H
52 #include <sysexits.h>
53 #else
54 /* todo: we should move this file out of win32, because it could be used
55  * on all platforms without it's own sysexits.h */
56 #include <win32/sysexits.h>
57 #endif
58 
59 #ifdef HAVE_SYS_WAIT_H
60 #include <sys/wait.h>
61 #endif
62 
63 #ifdef HAVE_SYS_SOCKET_H
64 #include <sys/socket.h>
65 #endif
66 
67 #ifdef HAVE_NETINET_IN_H
68 #include <netinet/in.h>
69 #endif
70 
71 #ifdef HAVE_NETDB_H
72 #include <netdb.h>
73 #endif
74 
75 #ifdef HAVE_UNISTD_H
76 #include <unistd.h>
77 #endif
78 
79 #ifdef HAVE_SYS_STAT_H
80 #include <sys/stat.h>
81 #endif
82 
83 #ifdef HAVE_SYS_UN_H
84 #include <sys/un.h>
85 #endif
86 
87 #ifdef HAVE_SYS_RESOURCE_H
88 #include <sys/resource.h>
89 #endif
90 
91 #ifdef HAVE_SYS_UIO_H
92 #include <sys/uio.h>
93 #endif
94 
95 #ifdef HAVE_NETINET_TCP_H
96 #include <netinet/tcp.h>
97 #endif
98 
99 #ifdef HAVE_ARPA_INET_H
100 #include <arpa/inet.h>
101 #endif
102 
103 
104 /* some POSIX systems need the following definition
105  * to get mlockall flags out of sys/mman.h. */
106 #ifndef _P1003_1B_VISIBLE
107 #define _P1003_1B_VISIBLE
108 #endif
109 /* need this to get IOV_MAX on some platforms. */
110 #ifndef __need_IOV_MAX
111 #define __need_IOV_MAX
112 #endif
113 
114 #ifdef HAVE_PWD_H
115 #include <pwd.h>
116 #endif
117 
118 #ifdef HAVE_SYS_MMAN_H
119 #include <sys/mman.h>
120 #endif
121 
122 /* FreeBSD 4.x doesn't have IOV_MAX exposed. */
123 #ifndef IOV_MAX
124 #if defined(__FreeBSD__) || defined(__APPLE__)
125 # define IOV_MAX 1024
126 #endif
127 #endif
128 
129 #if defined(ENABLE_SASL) || defined(ENABLE_ISASL)
130 #define SASL_ENABLED
131 #endif
132 
133 #endif