]> jfr.im git - solanum.git/blob - include/stdinc.h
Move irc_* data structures to librb.
[solanum.git] / include / stdinc.h
1 /*
2 * ircd-ratbox: A slightly useful ircd.
3 * stdinc.h: Pull in all of the necessary system headers
4 *
5 * Copyright (C) 2002 Aaron Sethman <androsyn@ratbox.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 * USA
21 *
22 */
23
24 #include "rb_lib.h"
25 #include "config.h" /* Gotta pull in the autoconf stuff */
26 #include "ircd_defs.h" /* Needed for some reasons here -- dwr */
27
28 /* AIX requires this to be the first thing in the file. */
29 #ifdef __GNUC__
30 #undef alloca
31 #define alloca __builtin_alloca
32 #else
33 # ifdef _MSC_VER
34 # include <malloc.h>
35 # define alloca _alloca
36 # else
37 # if HAVE_ALLOCA_H
38 # include <alloca.h>
39 # else
40 # ifdef _AIX
41 #pragma alloca
42 # else
43 # ifndef alloca /* predefined by HP cc +Olibcalls */
44 char *alloca ();
45 # endif
46 # endif
47 # endif
48 # endif
49 #endif
50
51
52 #ifdef HAVE_STDLIB_H
53 #include <stdlib.h>
54 #endif
55 #ifdef STRING_WITH_STRINGS
56 # include <string.h>
57 # include <strings.h>
58 #else
59 # ifdef HAVE_STRING_H
60 # include <string.h>
61 # else
62 # ifdef HAVE_STRINGS_H
63 # include <strings.h>
64 # endif
65 # endif
66 #endif
67
68
69 #ifdef HAVE_STDDEF_H
70 #include <stddef.h>
71 #endif
72
73
74
75 #include <stdio.h>
76 #include <assert.h>
77 #include <stdio.h>
78 #include <time.h>
79 #include <fcntl.h>
80 #include <netdb.h>
81 #include <stdarg.h>
82 #include <signal.h>
83 #include <dirent.h>
84 #include <ctype.h>
85
86 #include <limits.h>
87
88 #ifdef HAVE_UNISTD_H
89 #include <unistd.h>
90 #endif
91
92 #include <sys/time.h>
93 #include <sys/types.h>
94 #include <sys/file.h>
95 #ifdef HAVE_SYS_RESOURCE_H
96 #include <sys/resource.h>
97 #endif
98
99
100 #include <sys/socket.h>
101 #include <sys/stat.h>
102 #include <sys/wait.h>
103
104 #ifdef HAVE_SYS_PARAM_H
105 #include <sys/param.h>
106 #endif
107 #include <netinet/in.h>
108 #include <netinet/tcp.h>
109 #include <arpa/inet.h>
110
111 #ifdef HAVE_ERRNO_H
112 #include <errno.h>
113 #else
114 extern int errno;
115 #endif
116
117 #ifdef HAVE_SYS_UIO_H
118 #include <sys/uio.h>
119 #endif
120
121 #if defined(__INTEL_COMPILER) || defined(__GNUC__)
122 # ifdef __unused
123 # undef __unused
124 # endif
125 # ifdef __printf
126 # undef __printf
127 # endif
128 # ifdef __noreturn
129 # undef __noreturn
130 # endif
131
132 # define __unused __attribute__((__unused__))
133 # define __printf(x) __attribute__((__format__ (__printf__, x, x + 1)))
134 # define __noreturn __attribute__((__noreturn__))
135 #else
136 # define __unused
137 # define __printf
138 # define __noreturn
139 #endif
140
141
142
143 #ifdef strdupa
144 #define LOCAL_COPY(s) strdupa(s)
145 #else
146 #if defined(__INTEL_COMPILER) || defined(__GNUC__)
147 # define LOCAL_COPY(s) __extension__({ char *_s = alloca(strlen(s) + 1); strcpy(_s, s); _s; })
148 #else
149 # define LOCAL_COPY(s) strcpy(alloca(strlen(s) + 1), s) /* XXX Is that allowed? */
150 #endif /* defined(__INTEL_COMPILER) || defined(__GNUC__) */
151 #endif /* strdupa */