Annotation of parser3/src/include/pa_config_includes.h, revision 1.39

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

E-mail: