Annotation of parser3/src/include/pa_config_includes.h, revision 1.42
1.5 paf 1: /** @file
2: Parser: includes all Configure-d headers
3:
1.34 moko 4: Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com)
1.17 paf 5: Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.5 paf 6:
7: when used Configure [HAVE_CONFIG_H] it uses defines from Configure,
8: fixed otherwise.
9: */
1.10 parser 10:
1.25 paf 11: #ifndef PA_CONFIG_INCLUDES_H
12: #define PA_CONFIG_INCLUDES_H
13:
1.1 paf 14: #if HAVE_CONFIG_H
1.37 moko 15: # include "pa_config_auto.h"
1.1 paf 16: #else
1.37 moko 17: # include "pa_config_fixed.h"
1.6 paf 18: #endif
19:
1.37 moko 20: // AC_INCLUDES_DEFAULT
21:
22: #ifdef HAVE_STDIO_H
23: # include <stdio.h>
1.1 paf 24: #endif
25:
1.37 moko 26: #ifdef HAVE_SYS_TYPES_H
27: # include <sys/types.h>
1.25 paf 28: #endif
29:
1.37 moko 30: #ifdef HAVE_SYS_STAT_H
31: # include <sys/stat.h>
1.3 paf 32: #endif
33:
1.37 moko 34: #ifdef STDC_HEADERS
35: # include <stdlib.h>
36: # include <stddef.h>
37: #else
38: # ifdef HAVE_STDLIB_H
39: # include <stdlib.h>
40: # endif
1.3 paf 41: #endif
42:
1.37 moko 43: #ifdef HAVE_STRING_H
44: # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
45: # include <memory.h>
46: # endif
47: # include <string.h>
1.3 paf 48: #endif
49:
1.37 moko 50: #ifdef HAVE_STRINGS_H
51: # include <strings.h>
1.3 paf 52: #endif
53:
1.37 moko 54: #ifdef HAVE_INTTYPES_H
55: # include <inttypes.h>
1.3 paf 56: #endif
57:
1.37 moko 58: #ifdef HAVE_STDINT_H
59: # include <stdint.h>
1.1 paf 60: #endif
61:
1.37 moko 62: #ifdef HAVE_UNISTD_H
63: # include <unistd.h>
1.8 parser 64: #endif
65:
1.37 moko 66: // other includes
67:
68: #ifdef HAVE_ASSERT_H
69: # include <assert.h>
1.3 paf 70: #endif
71:
1.37 moko 72: #ifdef HAVE_LIMITS_H
73: # include <limits.h>
1.3 paf 74: #endif
75:
1.37 moko 76: #ifdef HAVE_CTYPE_H
77: # include <ctype.h>
1.1 paf 78: #endif
1.3 paf 79:
80: #ifdef HAVE_MATH_H
1.37 moko 81: # include <math.h>
1.3 paf 82: #endif
83:
1.37 moko 84: #ifdef HAVE_PROCESS_H
85: # include <process.h>
86: #endif
1.3 paf 87:
1.37 moko 88: #ifdef HAVE_STDARG_H
89: # include <stdarg.h>
1.3 paf 90: #endif
91:
1.37 moko 92: #ifdef HAVE_SETJMP_H
93: # include <setjmp.h>
1.35 moko 94: #endif
95:
1.37 moko 96: #ifdef HAVE_SIGNAL_H
97: # include <signal.h>
1.8 parser 98: #endif
99:
1.37 moko 100: #ifdef HAVE_ERRNO_H
101: # include <errno.h>
1.9 parser 102: #endif
103:
1.39 moko 104: #ifdef HAVE_DIRENT_H
105: # include <dirent.h>
106: #endif
107:
1.37 moko 108: #ifdef HAVE_FCNTL_H
109: # include <fcntl.h>
1.13 paf 110: #endif
111:
1.37 moko 112: #ifdef HAVE_IO_H
113: # include <io.h>
1.14 paf 114: #endif
115:
116: #ifdef HAVE_SYS_FILE_H
1.37 moko 117: # include <sys/file.h>
1.14 paf 118: #endif
119:
120: #ifdef HAVE_SYS_LOCKING_H
1.37 moko 121: # include <sys/locking.h>
1.14 paf 122: #endif
123:
1.37 moko 124: #ifdef HAVE_SYS_SELECT_H
125: # include <sys/select.h>
1.15 paf 126: #endif
127:
1.37 moko 128: #ifdef HAVE_SYS_RESOURCE_H
129: # include <sys/resource.h>
1.4 paf 130: #endif
1.21 paf 131:
1.42 ! moko 132: #ifdef HAVE_SYS_WAIT_H
! 133: # include <sys/wait.h>
! 134: #endif
! 135:
1.21 paf 136:
1.22 paf 137: #ifdef HAVE_SYS_SOCKET_H
1.37 moko 138: # include <sys/socket.h>
1.41 moko 139: #endif
140:
141: #ifdef HAVE_WINSOCK_H
142: # include <winsock.h>
1.25 paf 143: #endif
144:
1.22 paf 145: #ifdef HAVE_NETINET_IN_H
1.37 moko 146: # include <netinet/in.h>
1.22 paf 147: #endif
148:
149: #ifdef HAVE_ARPA_INET_H
1.37 moko 150: # include <arpa/inet.h>
1.22 paf 151: #endif
152:
153: #ifdef HAVE_NETDB_H
1.37 moko 154: # include <netdb.h>
1.22 paf 155: #endif
1.24 paf 156:
1.37 moko 157:
158: #if TIME_WITH_SYS_TIME
159: # include <sys/time.h>
160: # include <time.h>
161: #else
162: # ifdef HAVE_SYS_TIME_H
163: # include <sys/time.h>
164: # else
165: # include <time.h>
166: # endif
167: #endif
1.25 paf 168:
169: // math function replacements
170:
1.26 paf 171: #ifdef __cplusplus
172:
1.25 paf 173: #ifndef HAVE_TRUNC
174: inline double trunc(double param) { return param > 0? floor(param) : ceil(param); }
175: #endif
176:
177: #ifndef HAVE_ROUND
178: inline double round(double param) { return floor(param+0.5); }
179: #endif
180:
181: #ifndef HAVE_SIGN
182: inline double sign(double param) { return param > 0 ? 1 : ( param < 0 ? -1 : 0 ); }
183: #endif
184:
185: #if !defined(max)
1.24 paf 186: inline int max(int a, int b) { return a>b?a:b; }
187: inline int min(int a, int b){ return a<b?a:b; }
188: inline size_t max(size_t a, size_t b) { return a>b?a:b; }
189: inline size_t min(size_t a, size_t b){ return a<b?a:b; }
1.26 paf 190: #endif
191:
1.25 paf 192: #endif
193:
1.33 moko 194: #ifdef WIN32
195: #define THREAD_LOCAL __declspec(thread)
196: #else
197: #define THREAD_LOCAL // __thread // multithreading support required only for apache2 module
198: #endif
1.27 paf 199:
200: #if _MSC_VER
201:
1.37 moko 202: #pragma warning(disable:4355) // using this in calls to parent constructors
1.27 paf 203:
1.37 moko 204: #pragma warning(disable:4291) // no matching operator delete found; memory will not be freed if initialization throws an exception
1.27 paf 205:
1.37 moko 206: #pragma warning(disable:4786) // identifier was truncated to '255' characters in the debug information
1.27 paf 207:
1.37 moko 208: #pragma warning(disable:4511) // copy constructor could not be generated
1.27 paf 209:
1.37 moko 210: #pragma warning(disable:4512) // assignment operator could not be generated
1.27 paf 211:
1.37 moko 212: #pragma warning(disable:4505) // unreferenced local function has been removed
1.27 paf 213:
1.37 moko 214: #pragma warning(disable:4127) // conditional expression is constant; while(true) OK
1.27 paf 215:
1.37 moko 216: #pragma warning(disable:4706) // assignment within conditional expression if(type var=somethig) OK
1.27 paf 217:
1.37 moko 218: #pragma warning(disable:4996) // memcpy deprecation
1.29 paf 219:
1.27 paf 220: #endif
221:
1.32 paf 222: /// to debug backtrace pointers switch this on:
223: #if defined(_DEBUG) || defined(PA_RELEASE_ASSERTS)
224: //// this switches on straightforward realloc implementation, bad for profiling
225: //// note: this is incompatible with -DGC_ASSERTIONS, which can be switched ON in win32/gc/NT_THREADS_MAKEFILE
226: #define GC_DEBUG
227: #endif
228:
1.24 paf 229: #endif
E-mail: