util/xmlBlasterDef.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002 Name:      xmlBlasterDef.h
00003 Project:   xmlBlaster.org
00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
00005 Comment:   Contains general definitions commonly used in the project
00006 Version:   $Id: xmlBlasterDef.h 13444 2005-07-15 01:53:27Z ruff $
00007 ------------------------------------------------------------------------------*/
00008 
00009 #ifndef _UTIL_XMLBLASTERDEF_H
00010 #define _UTIL_XMLBLASTERDEF_H
00011 
00012 #ifdef _WINDOWS
00013 #pragma warning(disable:4786)
00014 #pragma warning(disable:4251)
00015 #endif
00016 
00017 #include <util/XmlBCfg.h>
00018 //NEW: #include <util/basicDefs.h> // definition for Dll_Export, int64_t, the timestamps ... (see C-client library xmlBlaster/src/c/util/basicDefs.h)
00019 
00020 // copied from xmlBlaster/src/c/util/basicDefs.h:
00021 #if defined(_WINDOWS)
00022   typedef __int64 int64_t;
00023 # define PRINTF_PREFIX_INT64_T "%I64d"
00024   /*typedef long long int64_t;*/
00025   typedef __int32 int32_t;
00026   typedef __int16 int16_t;
00027 #else
00028 
00029 /* FreeBSD uses inttypes.h, not stdint.h.  Boost's lib suggests
00030    this should read  defined(__FreeBSD__) || defined(__IBMCPP__)
00031 */
00032 # if defined(__FreeBSD__) 
00033 #   include <inttypes.h>
00034 # elif defined(__sun)
00035     /*#   include <int_types.h>*/ /* /usr/include/sys/int_types.h */
00036 # elif defined(__hpux)
00037   /*typedef long long int64_t;*/
00038   /*#   include <int_types.h>*/ /* /usr/include/sys/int_types.h */
00039 # else
00040 #   include <stdint.h>  /*-> C99:  uint64_t etc. */
00041 # endif
00042 #endif
00043 
00044 #include <string> // need for XMLBLASTER_TRUE/XMLBLASTER_FALSE, shall we replace it by defines and throw out this include?
00045 
00046 // definition for the timestamps (see xmlBlaster/src/c/util/basicDefs.h)
00047 namespace org { namespace xmlBlaster { namespace util {
00048 
00049 static const std::string XMLBLASTER_TRUE("true");
00050 static const std::string XMLBLASTER_FALSE("false");
00051 
00052 typedef int64_t Timestamp;
00053 
00054 // change this if it does not compile correctly
00055 // #define STRING_TO_TIMESTAMP(x) atoll(x)
00056 // #define      STRING_TO_TIMESTAMP(x) lexical_cast<org::xmlBlaster::util::Timestamp>(x)
00057 
00058 #ifndef _UTIL_GLOBAL_H
00059    class Global; // forward declaration for (chicken-egg)
00060 #endif
00061 
00062 }}} // org::xmlBlaster::util
00063 
00064 // This is useful to retrieve stack traces in exceptions. If your system
00065 // contains execinfo.h then you can add the ifdef of that system here.
00066 #ifdef __GNUC__ 
00067 #ifndef __sun__
00068 #ifdef _ENABLE_STACK_TRACE_  // is set in build.xml
00069 #include <execinfo.h>
00070 #endif
00071 #endif
00072 #endif
00073 
00074 #endif