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