Annotation of parser3/src/include/pa_config_includes.h, revision 1.38
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.37 moko 104: #ifdef HAVE_FCNTL_H
105: # include <fcntl.h>
1.13 paf 106: #endif
107:
1.37 moko 108: #ifdef HAVE_IO_H
109: # include <io.h>
1.14 paf 110: #endif
111:
112: #ifdef HAVE_SYS_FILE_H
1.37 moko 113: # include <sys/file.h>
1.14 paf 114: #endif
115:
116: #ifdef HAVE_SYS_LOCKING_H
1.37 moko 117: # include <sys/locking.h>
1.14 paf 118: #endif
119:
1.37 moko 120: #ifdef HAVE_SYS_SELECT_H
121: # include <sys/select.h>
1.15 paf 122: #endif
123:
1.37 moko 124: #ifdef HAVE_SYS_RESOURCE_H
125: # include <sys/resource.h>
1.4 paf 126: #endif
1.21 paf 127:
128:
1.22 paf 129: #ifdef HAVE_SYS_SOCKET_H
1.37 moko 130: # include <sys/socket.h>
1.25 paf 131: #else
1.37 moko 132: # if defined(HAVE_WINSOCK_H) && !defined(_MSC_VER) && !defined(CYGWIN)
133: # include <winsock.h>
134: # endif
1.25 paf 135: #endif
136:
1.22 paf 137: #ifdef HAVE_NETINET_IN_H
1.37 moko 138: # include <netinet/in.h>
1.22 paf 139: #endif
140:
141: #ifdef HAVE_ARPA_INET_H
1.37 moko 142: # include <arpa/inet.h>
1.22 paf 143: #endif
144:
145: #ifdef HAVE_NETDB_H
1.37 moko 146: # include <netdb.h>
1.22 paf 147: #endif
1.24 paf 148:
1.37 moko 149: // must go anywhere after winsock [cygwin time.h checks for already inclusion of winsock.h]
150:
151: #if TIME_WITH_SYS_TIME
152: # include <sys/time.h>
153: # include <time.h>
154: #else
155: # ifdef HAVE_SYS_TIME_H
156: # include <sys/time.h>
157: # else
158: # include <time.h>
159: # endif
160: #endif
1.25 paf 161:
162: // math function replacements
163:
1.26 paf 164: #ifdef __cplusplus
165:
1.25 paf 166: #ifndef HAVE_TRUNC
167: inline double trunc(double param) { return param > 0? floor(param) : ceil(param); }
168: #endif
169:
170: #ifndef HAVE_ROUND
171: inline double round(double param) { return floor(param+0.5); }
172: #endif
173:
174: #ifndef HAVE_SIGN
175: inline double sign(double param) { return param > 0 ? 1 : ( param < 0 ? -1 : 0 ); }
176: #endif
177:
178: #if !defined(max)
1.24 paf 179: inline int max(int a, int b) { return a>b?a:b; }
180: inline int min(int a, int b){ return a<b?a:b; }
181: inline size_t max(size_t a, size_t b) { return a>b?a:b; }
182: inline size_t min(size_t a, size_t b){ return a<b?a:b; }
1.26 paf 183: #endif
184:
1.25 paf 185: #endif
186:
1.33 moko 187: #ifdef WIN32
188: #define THREAD_LOCAL __declspec(thread)
189: #else
190: #define THREAD_LOCAL // __thread // multithreading support required only for apache2 module
191: #endif
1.27 paf 192:
193: #if _MSC_VER
194:
1.37 moko 195: #pragma warning(disable:4355) // using this in calls to parent constructors
1.27 paf 196:
1.37 moko 197: #pragma warning(disable:4291) // no matching operator delete found; memory will not be freed if initialization throws an exception
1.27 paf 198:
1.37 moko 199: #pragma warning(disable:4786) // identifier was truncated to '255' characters in the debug information
1.27 paf 200:
1.37 moko 201: #pragma warning(disable:4511) // copy constructor could not be generated
1.27 paf 202:
1.37 moko 203: #pragma warning(disable:4512) // assignment operator could not be generated
1.27 paf 204:
1.37 moko 205: #pragma warning(disable:4505) // unreferenced local function has been removed
1.27 paf 206:
1.37 moko 207: #pragma warning(disable:4127) // conditional expression is constant; while(true) OK
1.27 paf 208:
1.37 moko 209: #pragma warning(disable:4706) // assignment within conditional expression if(type var=somethig) OK
1.27 paf 210:
1.37 moko 211: #pragma warning(disable:4996) // memcpy deprecation
1.29 paf 212:
1.27 paf 213: #endif
214:
1.32 paf 215: /// to debug backtrace pointers switch this on:
216: #if defined(_DEBUG) || defined(PA_RELEASE_ASSERTS)
217: //// this switches on straightforward realloc implementation, bad for profiling
218: //// note: this is incompatible with -DGC_ASSERTIONS, which can be switched ON in win32/gc/NT_THREADS_MAKEFILE
219: #define GC_DEBUG
220: #endif
221:
1.24 paf 222: #endif
E-mail: