BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
COMMON/global.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_COMMON_GLOBAL_H
6 #define BALL_COMMON_GLOBAL_H
7 
8 #ifndef BALL_CONFIG_CONFIG_H
9 # include <BALL/CONFIG/config.h>
10 #endif
11 
12 #include <limits>
13 #include <time.h>
14 
15 #ifdef BALL_HAS_BASETSD_H
16 # include <basetsd.h>
17 #endif
18 
19 // If possible use the ISO C99-compliant header stdint.h
20 // to define the portable integer types.
21 #ifdef BALL_HAS_STDINT_H
22 # include <stdint.h>
23 #endif
24 
25 #ifdef BALL_COMPILER_MSVC
26 # define BALL_HIDE
27 # ifdef BALL_BUILD_DLL
28 # define BALL_EXPORT __declspec(dllexport)
29 # define BALL_EXTERN_VARIABLE __declspec(dllexport) extern
30 # else
31 # define BALL_EXPORT __declspec(dllimport)
32 # define BALL_EXTERN_VARIABLE __declspec(dllimport) extern
33 # endif
34 # ifdef BALL_VIEW_BUILD_DLL
35 # define BALL_VIEW_EXPORT __declspec(dllexport)
36 # else
37 # define BALL_VIEW_EXPORT __declspec(dllimport)
38 # endif
39 #elif defined(BALL_COMPILER_GXX) && (BALL_COMPILER_VERSION_MAJOR > 4 || (BALL_COMPILER_VERSION_MAJOR == 4 && BALL_COMPILER_VERSION_MINOR >= 3))
40 # define BALL_EXPORT __attribute__((visibility ("default")))
41 # define BALL_HIDE __attribute__((visibility ("hidden")))
42 # define BALL_VIEW_EXPORT __attribute__((visibility ("default")))
43 # define BALL_EXTERN_VARIABLE extern __attribute__((visibility ("default")))
44 #else
45 # define BALL_EXPORT
46 # define BALL_HIDE
47 # define BALL_VIEW_EXPORT
48 # define BALL_EXTERN_VARIABLE extern
49 #endif
50 
51 //This declares a BALL_DEPRECATED macro that can be used to mark deprecated api
52 //It is essentially copied from Qt 4.4.1 but simplified, thus there might be
53 //some cases where it does not work as expected, yet.
54 #if defined(BALL_COMPILER_MSVC) && (_MSC_VER >= 1300)
55  #define BALL_DEPRECATED __declspec(deprecated)
56 #elif defined(BALL_COMPILER_GXX) && (BALL_COMPILER_VERSION_MAJOR - 0 > 3 || (BALL_COMPILER_VERSION_MAJOR - 0 == 3 && BALL_COMPILER_VERSION_MINOR - 0 >= 2))
57  #define BALL_DEPRECATED __attribute__((deprecated))
58 #else
59  #define BALL_DEPRECATED
60 #endif
61 
62 namespace BALL
63 {
64 
65  typedef int (*ComparatorType)(const void *, const void *);
66 
74 
82 
92 
101 
110 
118  typedef time_t Time;
119 
127 
136 
143  typedef float Real;
144 
151  typedef double DoubleReal;
152 
161 
169 
170 
178  typedef unsigned char Byte;
179 
187  typedef BALL_ULONG64_TYPE LongSize;
188 
196  typedef BALL_LONG64_TYPE LongIndex;
197 
202  typedef BALL_POINTERSIZEUINT_TYPE PointerSizeUInt;
203 
205 
206  enum ASCII
207  {
209  ASCII__BELL = '\a',
217 
224  };
225 
229 
231  static const Handle HANDLE_MIN = 0 ;
233 
234  static const Index INVALID_INDEX = -1;
235  static const Index INDEX_MIN = 0;
237 
239  static const Position POSITION_MIN = 0;
241 
242 # undef SIZE_MAX
244  static const Size SIZE_MIN = 0;
246 
247 
248 }
249 
250 #endif // BALL_COMMON_GLOBAL_H