Annotation of parser3/src/include/pa_types.h, revision 1.42

1.17      paf         1: /** @file
1.18      paf         2:        Parser: generally used types & constants decls.
                      3: 
1.36      paf         4:        Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com)
1.37      paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.2       paf         6: */
                      7: 
1.1       paf         8: #ifndef PA_TYPES_H
                      9: #define PA_TYPES_H
1.42    ! paf        10: 
        !            11: static const char* IDENT_TYPES_H="$Id: zzz $";
1.1       paf        12: 
1.23      paf        13: #include "pa_config_includes.h"
1.2       paf        14: 
1.23      paf        15: #if _MSC_VER
1.27      parser     16: // using this in calls to parent constructors
                     17: #pragma warning(disable:4355)   
                     18: 
                     19: //#    pragma warning(disable:4065)   // switch statement contains 'default' 
1.23      paf        20:                                                                   // but no 'case' labels
1.27      parser     21: //#    pragma warning(disable:4800)   // (bool)(1&2)
                     22: 
                     23: // assignment operator could not be generated
                     24: //#pragma warning(disable:4512) 
1.28      parser     25: 
                     26: // identifier was truncated to '255' characters in the debug information
                     27: #pragma warning(disable:4786)
1.35      paf        28: 
                     29: #ifdef _DEBUG
                     30: #      define _CRTDBG_MAP_ALLOC
                     31: // When the _CRTDBG_MAP_ALLOC flag is defined in the debug version of an application, 
                     32: // the base version of the heap functions are directly mapped to their debug versions
                     33: #endif
1.27      parser     34: 
1.14      paf        35: #endif
1.4       paf        36: 
1.17      paf        37: /// for rare cases of undefined length using this-sized strings
1.15      paf        38: #define MAX_STRING 0x400
1.17      paf        39: /// for snprintf(buf, MAX_NUMBER, "%.2f")
1.12      paf        40: #define MAX_NUMBER 40
1.2       paf        41: 
1.40      paf        42: //{@ handy types
1.34      paf        43: #undef uchar
                     44: typedef unsigned char uchar;
                     45: 
1.33      paf        46: #undef ushort
                     47: typedef unsigned short ushort;
1.34      paf        48: 
1.1       paf        49: #undef uint
1.33      paf        50: typedef unsigned int uint;
1.34      paf        51: 
1.24      paf        52: #undef ulong
                     53: typedef unsigned long ulong;
1.40      paf        54: //}@
1.2       paf        55: 
1.38      paf        56: /// max value of integral type
                     57: #define max_integral(type) ((1<<sizeof(type)*8)-1)
                     58: 
                     59: 
1.7       paf        60: #ifndef NO_STRING_ORIGIN
1.17      paf        61: /// all String pieces hold information of where they come from
1.29      paf        62: 
1.41      paf        63: // all classes that are members parents of packed class [String] 
                     64: // sould be packed also to avoid sparc odd st/lduh problem
1.30      paf        65: #include "pa_pragma_pack_begin.h"
1.4       paf        66: struct Origin {
1.17      paf        67:        const char *file;  ///< macros file name | load file name | sql query text
1.29      paf        68:        unsigned short line; ///< file line no | record no
1.7       paf        69: };
1.38      paf        70: #include "pa_pragma_pack_end.h"
1.32      paf        71: #define ORIGIN_FILE_LINE_FORMAT "%.300s(%d)"
1.29      paf        72: 
1.39      paf        73: /** helper used from body from STRING_FOREACH_ROW 
                     74:        to make preprocessor do if before macro expansion, 
                     75:        not after[which is impossible and caused errors]
                     76: */
                     77: #define IFNDEF_NO_STRING_ORIGIN(body) body
                     78: 
                     79: #else
                     80: #define IFNDEF_NO_STRING_ORIGIN(body)
1.2       paf        81: #endif
1.1       paf        82: 
                     83: #endif

E-mail: