libsbml-draw
SagittariusCommon.h
Go to the documentation of this file.
1 /* MIT License
2  */
3 
4 //== FILEDOC =========================================================================
5 
11 //== BEGINNING OF CODE ===============================================================
12 
13 #ifndef __SAGITTARIUS_COMMON_H_
14 #define __SAGITTARIUS_COMMON_H_
15 
16 //== INCLUDES ========================================================================
17 
18 #include "SagittariusPlatform.h"
19 #include "config.h"
20 
21 #ifdef __cplusplus
22  #include <string>
23  #include <vector>
24  #include <list>
25  #include <complex>
26 #endif
27 
28 // Standard macros
29 // http://stackoverflow.com/questions/3419332/c-preprocessor-stringify-the-result-of-a-macro
30 #define QUOTE(ARG) #ARG
31 #define EXPAND_AND_QUOTE(ARG) QUOTE(ARG)
32 // http://www.altdevblogaday.com/2011/07/12/abusing-the-c-preprocessor/
33 #define JOIN(x, y) x##y
34 
35 #ifdef __cplusplus
36 namespace LibsbmlDraw
37 {
38 #endif
39 
40  //C99 compatibility
41  #ifndef __cplusplus
42  #if __STDC_VERSION__ < 199901L
43  // Gave up
44  //# error "C99 Support is REQUIRED"
45  #endif
46  #endif
47 
48  //maximum unsigned char...
49  #if SAGITTARIUS_PLATFORM == SAGITTARIUS_PLATFORM_LINUX
50  # if SAGITTARIUS_ARCH == SAGITTARIUS_ARCH_64
51  # define PLATFORM_UCHAR_MAX 256
52  # elif SAGITTARIUS_ARCH == SAGITTARIUS_ARCH_32
53  # define PLATFORM_UCHAR_MAX 256
54  # endif
55  #elif SAGITTARIUS_PLATFORM == SAGITTARIUS_PLATFORM_WIN
56  # if SAGITTARIUS_ARCH == SAGITTARIUS_ARCH_64
57  # define PLATFORM_UCHAR_MAX 256
58  # elif SAGITTARIUS_ARCH == SAGITTARIUS_ARCH_32
59  # define PLATFORM_UCHAR_MAX 256
60  # endif
61  #elif SAGITTARIUS_PLATFORM == SAGITTARIUS_PLATFORM_APPLE
62  # if SAGITTARIUS_ARCH == SAGITTARIUS_ARCH_64
63  # define PLATFORM_UCHAR_MAX 256
64  # elif SAGITTARIUS_ARCH == SAGITTARIUS_ARCH_32
65  # define PLATFORM_UCHAR_MAX 256
66  # endif
67  #endif
68 
70  #define SAGITTARIUS_REAL double
71  #define GF_PYREALFMT "d"
72 
74  #define SAGITTARIUS_DEBUG_LEVEL SBNW_DEBUG_LEVEL
75 
76  //C++ typedefs
77 
78  #ifdef __cplusplus
79 
81  typedef SAGITTARIUS_REAL Real;
82 
83  typedef std::complex<Real> Complex;
84 
85  extern const Real pi;
86 
87  #if SAGITTARIUS_USE_WIDE_STRINGS
88  typedef std::wstring _String;
90  #else
91  typedef std::string _String;
92  #endif
93 
95  typedef _String String;
97  typedef _String ASCIIString;
98 
100  typedef unsigned long index_t;
101 
102  #endif//End of C++ typedefs
103 
104 #ifdef __cplusplus
105 } //namespace Graphfab
106 #endif
107 
108 
109 //C typedefs
111 // FIXME: this will cause problems
113 
114 
115 #endif
SAGITTARIUS_REAL Real
Make Real visible to C. Consider letting Real lie in top namespace.
Definition: SagittariusCommon.h:112
#define SAGITTARIUS_REAL
See typedef below.
Definition: SagittariusCommon.h:70
Autogenerated configure header.
Platform information (client switch is in here)