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

1.5       paf         1: /** @file
                      2:        Parser: includes all Configure-d headers
                      3: 
1.31      paf         4:        Copyright (c) 2001-2005 ArtLebedev Group (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.10      parser     14: #if _MSC_VER
                     15: #      pragma warning(disable:4291)   // disable warning 
                     16: //     "no matching operator delete found; memory will not be freed if initialization throws an exception
                     17: #endif
1.5       paf        18: 
1.1       paf        19: #if HAVE_CONFIG_H
                     20: #      include "pa_config_auto.h"
                     21: #else
                     22: #      include "pa_config_fixed.h"
1.6       paf        23: #endif
                     24: 
1.7       paf        25: #ifdef __cplusplus
                     26: #      undef   inline
1.1       paf        27: #endif
                     28: 
1.25      paf        29: #ifdef HAVE_ASSERT_H
                     30: #      include <assert.h>
                     31: #endif
                     32: 
1.3       paf        33: #ifdef HAVE_CTYPE_H
                     34: #      include <ctype.h>
                     35: #endif
                     36: 
                     37: #ifdef HAVE_ERRNO_H
                     38: #      include <errno.h>
                     39: #endif
                     40: 
                     41: #ifdef HAVE_FCNTL_H
                     42: #      include <fcntl.h>
                     43: #endif
                     44: 
                     45: #ifdef HAVE_IO_H
                     46: #      include <io.h>
                     47: #endif
                     48: 
                     49: #ifdef HAVE_PROCESS_H
                     50: #      include <process.h>
                     51: #endif
                     52: 
1.1       paf        53: #ifdef HAVE_STDARG_H
                     54: #      include <stdarg.h>
                     55: #endif
                     56: 
1.8       parser     57: #ifdef HAVE_STDDEF_H
                     58: #      include <stddef.h>
                     59: #endif
                     60: 
1.3       paf        61: #ifdef HAVE_STDIO_H
                     62: #      include <stdio.h>
                     63: #endif
                     64: 
                     65: #ifdef HAVE_SYS_STAT_H
                     66: #      include <sys/stat.h>
                     67: #endif
                     68: 
                     69: #if defined(HAVE_UNISTD_H) && !defined(NO_UNISTD_H)
1.1       paf        70: #      include <unistd.h>
                     71: #endif
1.3       paf        72: 
                     73: #ifdef HAVE_MATH_H
                     74: #      include <math.h>
                     75: #endif
                     76: 
1.25      paf        77: #include <stdlib.h>
1.3       paf        78: 
                     79: #ifdef HAVE_STRING_H
                     80: #      include <string.h>
                     81: #endif
                     82: 
1.4       paf        83: #ifdef HAVE_DIRECT_H
                     84: #      include <direct.h>
1.8       parser     85: #endif
                     86: 
                     87: #ifdef HAVE_SETJMP_H
                     88: #      include <setjmp.h>
1.9       parser     89: #endif
                     90: 
                     91: #ifdef HAVE_MEMORY_H
                     92: #      include <memory.h>
1.13      paf        93: #endif
                     94: 
                     95: #ifdef HAVE_NEW
                     96: #include <new>
1.14      paf        97: #endif
                     98: 
                     99: #ifdef HAVE_SYS_FILE_H
                    100: #include <sys/file.h>
                    101: #endif
                    102: 
                    103: #ifdef HAVE_SYS_LOCKING_H
                    104: #include <sys/locking.h>
                    105: #endif
                    106: 
                    107: #ifdef HAVE_SYS_TYPES_H
                    108: #include <sys/types.h>
1.15      paf       109: #endif
                    110: 
                    111: #ifdef HAVE_SYS_SELECT_H
                    112: #include <sys/select.h>
1.4       paf       113: #endif
1.21      paf       114: 
                    115: #ifdef HAVE_SIGNAL_H
                    116: #include <signal.h>
                    117: #endif
                    118: 
1.22      paf       119: #ifdef HAVE_SYS_SOCKET_H
1.25      paf       120: #      include <sys/socket.h>
                    121: #else
                    122: #      if defined(HAVE_WINSOCK_H) && !defined(_MSC_VER) && !defined(CYGWIN)
                    123: #              include <winsock.h>
                    124: #      endif
1.22      paf       125: #endif
                    126: 
1.25      paf       127: // must go anywhere after winsock [cygwin time.h checks for already inclusion of winsock.h]
                    128: #if TIME_WITH_SYS_TIME
                    129: #      include <sys/time.h>
                    130: #      include <time.h>
                    131: #else
                    132: #      ifdef HAVE_SYS_TIME_H
                    133: #              include <sys/time.h>
                    134: #      else
                    135: #              include <time.h>
                    136: #      endif
                    137: #endif
                    138: 
                    139: 
1.22      paf       140: #ifdef HAVE_NETINET_IN_H
                    141: #include <netinet/in.h>
                    142: #endif
                    143: 
                    144: #ifdef HAVE_ARPA_INET_H
                    145: #include <arpa/inet.h>
                    146: #endif
                    147: 
                    148: #ifdef HAVE_NETDB_H
                    149: #include <netdb.h>
                    150: #endif
1.24      paf       151: 
1.25      paf       152: 
                    153: // math function replacements
                    154: 
1.26      paf       155: #ifdef __cplusplus
                    156: 
1.25      paf       157: #ifndef HAVE_TRUNC
                    158: inline double trunc(double param) { return param > 0? floor(param) : ceil(param); }
                    159: #endif
                    160: 
                    161: #ifndef HAVE_ROUND
                    162: inline double round(double param) { return floor(param+0.5); }
                    163: #endif
                    164: 
                    165: #ifndef HAVE_SIGN
                    166: inline double sign(double param) { return param > 0 ? 1 : ( param < 0 ? -1 : 0 ); }
                    167: #endif
                    168: 
                    169: #if !defined(max)
1.24      paf       170: inline int max(int a, int b) { return a>b?a:b; }
                    171: inline int min(int a, int b){ return a<b?a:b; }
                    172: inline size_t max(size_t a, size_t b) { return a>b?a:b; }
                    173: inline size_t min(size_t a, size_t b){ return a<b?a:b; }
1.26      paf       174: #endif
                    175: 
1.25      paf       176: #endif
                    177: 
1.33    ! moko      178: #ifdef WIN32
        !           179: #define THREAD_LOCAL __declspec(thread)
        !           180: #else
        !           181: #define THREAD_LOCAL // __thread // multithreading support required only for apache2 module
        !           182: #endif
1.27      paf       183: 
                    184: #if _MSC_VER
                    185: // using this in calls to parent constructors
                    186: #pragma warning(disable:4355)   
                    187: 
                    188: //#    pragma warning(disable:4065)   // switch statement contains 'default' 
                    189:                                                                   // but no 'case' labels
                    190: //#    pragma warning(disable:4800)   // (bool)(1&2)
                    191: 
                    192: // assignment operator could not be generated
                    193: //#pragma warning(disable:4512) 
                    194: 
                    195: // identifier was truncated to '255' characters in the debug information
                    196: #pragma warning(disable:4786)
                    197: 
                    198: // copy constructor could not be generated
                    199: #pragma warning(disable:4511)
                    200: 
                    201: // assignment operator could not be generated
                    202: #pragma warning(disable:4512)
                    203: 
                    204: // unreferenced local function has been removed
                    205: #pragma warning(disable:4505)
                    206: 
                    207: // conditional expression is constant; while(true) OK
                    208: #pragma warning(disable:4127)
                    209: 
                    210: // assignment within conditional expression if(type var=somethig) OK
                    211: #pragma warning(disable:4706)
                    212: 
1.29      paf       213: // memcpy deprecation
                    214: #pragma warning(disable:4996)
                    215: 
1.27      paf       216: 
                    217: #if 0
                    218: #ifdef _DEBUG
                    219: #      define _CRTDBG_MAP_ALLOC
                    220: // When the _CRTDBG_MAP_ALLOC flag is defined in the debug version of an application, 
                    221: // the base version of the heap functions are directly mapped to their debug versions
                    222: #endif
                    223: #endif
                    224: 
                    225: #endif
                    226: 
1.30      paf       227: #ifdef PA_RELEASE_ASSERTS
                    228: // this helps to remove warnings on helper-to-assert variables
                    229: #undef NDEBUG
                    230: // pa_globals.C
                    231: void pa_release_assert(const char* str, const char* file, int line);
                    232: #undef assert
                    233: #define assert(exp) (void)( (exp) || (pa_release_assert(#exp, __FILE__, __LINE__), 0) )
                    234: #endif
                    235: 
1.32      paf       236: /// to debug backtrace pointers switch this on:
                    237: #if defined(_DEBUG) || defined(PA_RELEASE_ASSERTS)
                    238: //// this switches on straightforward realloc implementation, bad for profiling
                    239: //// note: this is incompatible with -DGC_ASSERTIONS, which can be switched ON in win32/gc/NT_THREADS_MAKEFILE
                    240: #define GC_DEBUG
                    241: #endif
                    242: 
1.24      paf       243: #endif

E-mail: