1 /*------------------------------------------------------------------------------
2 Name: xmlBlasterDef.h
3 Project: xmlBlaster.org
4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
5 Comment: Contains general definitions commonly used in the project
6 Version: $Id: xmlBlasterDef.h 13444 2005-07-15 01:53:27Z ruff $
7 ------------------------------------------------------------------------------*/
8
9 #ifndef _UTIL_XMLBLASTERDEF_H
10 #define _UTIL_XMLBLASTERDEF_H
11
12 #ifdef _WINDOWS
13 #pragma warning(disable:4786)
14 #pragma warning(disable:4251)
15 #endif
16
17 #include <util/XmlBCfg.h>
18 //NEW: #include <util/basicDefs.h> // definition for Dll_Export, int64_t, the timestamps ... (see C-client library xmlBlaster/src/c/util/basicDefs.h)
19
20 // copied from xmlBlaster/src/c/util/basicDefs.h:
21 #if defined(_WINDOWS)
22 typedef __int64 int64_t;
23 # define PRINTF_PREFIX_INT64_T "%I64d"
24 /*typedef long long int64_t;*/
25 typedef __int32 int32_t;
26 typedef __int16 int16_t;
27 #else
28
29 /* FreeBSD uses inttypes.h, not stdint.h. Boost's lib suggests
30 this should read defined(__FreeBSD__) || defined(__IBMCPP__)
31 */
32 # if defined(__FreeBSD__)
33 # include <inttypes.h>
34 # elif defined(__sun)
35 /*# include <int_types.h>*/ /* /usr/include/sys/int_types.h */
36 # elif defined(__hpux)
37 /*typedef long long int64_t;*/
38 /*# include <int_types.h>*/ /* /usr/include/sys/int_types.h */
39 # else
40 # include <stdint.h> /*-> C99: uint64_t etc. */
41 # endif
42 #endif
43
44 #include <string> // need for XMLBLASTER_TRUE/XMLBLASTER_FALSE, shall we replace it by defines and throw out this include?
45
46 // definition for the timestamps (see xmlBlaster/src/c/util/basicDefs.h)
47 namespace org { namespace xmlBlaster { namespace util {
48
49 static const std::string XMLBLASTER_TRUE("true");
50 static const std::string XMLBLASTER_FALSE("false");
51
52 typedef int64_t Timestamp;
53
54 // change this if it does not compile correctly
55 // #define STRING_TO_TIMESTAMP(x) atoll(x)
56 // #define STRING_TO_TIMESTAMP(x) lexical_cast<org::xmlBlaster::util::Timestamp>(x)
57
58 #ifndef _UTIL_GLOBAL_H
59 class Global; // forward declaration for (chicken-egg)
60 #endif
61
62 }}} // org::xmlBlaster::util
63
64 // This is useful to retrieve stack traces in exceptions. If your system
65 // contains execinfo.h then you can add the ifdef of that system here.
66 #ifdef __GNUC__
67 #ifndef __sun__
68 #ifdef _ENABLE_STACK_TRACE_ // is set in build.xml
69 #include <execinfo.h>
70 #endif
71 #endif
72 #endif
73
74 #endif
syntax highlighted by Code2HTML, v. 0.9.1