BALL 1.5.0
Loading...
Searching...
No Matches
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# elif defined(BALL_COMPILER_LLVM)
45# define BALL_EXPORT __attribute__((visibility ("default")))
46# define BALL_HIDE __attribute__((visibility ("hidden")))
47# define BALL_VIEW_EXPORT __attribute__((visibility ("default")))
48# define BALL_EXTERN_VARIABLE extern __attribute__((visibility ("default")))
49#else
50# define BALL_EXPORT
51# define BALL_HIDE
52# define BALL_VIEW_EXPORT
53# define BALL_EXTERN_VARIABLE extern
54#endif
55
56//This declares a BALL_DEPRECATED macro that can be used to mark deprecated api
57//It is essentially copied from Qt 4.4.1 but simplified, thus there might be
58//some cases where it does not work as expected, yet.
59#if defined(BALL_COMPILER_MSVC) && (_MSC_VER >= 1300)
60 #define BALL_DEPRECATED __declspec(deprecated)
61#elif defined(BALL_COMPILER_GXX) || defined(BALL_COMPILER_LLVM)
62 #define BALL_DEPRECATED __attribute__((deprecated))
63#else
64 #define BALL_DEPRECATED
65#endif
66
67namespace BALL
68{
69
70 typedef int (*ComparatorType)(const void *, const void *);
71
79
87
97
106
115
123 typedef time_t Time;
124
132
141
148 typedef float Real;
149
156 typedef double DoubleReal;
157
166
174
175
183 typedef unsigned char Byte;
184
192 typedef BALL_ULONG64_TYPE LongSize;
193
201 typedef BALL_LONG64_TYPE LongIndex;
202
207 typedef BALL_POINTERSIZEUINT_TYPE PointerSizeUInt;
208
210
230
231 static const Distance INVALID_Distance = std::numeric_limits<Distance>::max();
232 static const Distance Distance_MIN = (std::numeric_limits<Distance>::min() + 1);
233 static const Distance Distance_MAX = std::numeric_limits<Distance>::max();
234
235 static const Handle INVALID_Handle = std::numeric_limits<Handle>::max();
236 static const Handle Handle_MIN = 0 ;
237 static const Handle Handle_MAX = std::numeric_limits<Handle>::max() - 1;
238
239 static const Index INVALID_Index = -1;
240 static const Index Index_MIN = 0;
241 static const Index Index_MAX = std::numeric_limits<Index>::max();
242
243 static const Position INVALID_Position = std::numeric_limits<Position>::max();
244 static const Position Position_MIN = 0;
245 static const Position Position_MAX = std::numeric_limits<Position>::max() - 1;
246
247 static const Size INVALID_Size = std::numeric_limits<Size>::max();
248 static const Size Size_MIN = 0;
249 static const Size Size_MAX = std::numeric_limits<Size>::max() - 1;
250
251
252}
253
254#endif // BALL_COMMON_GLOBAL_H
static const Size Size_MAX
static const Handle Handle_MIN
static const Distance INVALID_Distance
BALL_SIZE_TYPE HashIndex
static const Position Position_MIN
static const Position INVALID_Position
BALL_SIZE_TYPE Size
static const Size INVALID_Size
time_t Time
BALL_POINTERSIZEUINT_TYPE PointerSizeUInt
double DoubleReal
BALL_SIZE_TYPE Property
BALL_ULONG64_TYPE LongSize
@ ASCII__POINT
@ ASCII__HORIZONTAL_TAB
@ ASCII__EXCLAMATION_MARK
@ ASCII__BELL
@ ASCII__COMMA
@ ASCII__CARRIAGE_RETURN
@ ASCII__BACKSPACE
@ ASCII__VERTICAL_TAB
@ ASCII__SPACE
@ ASCII__SEMICOLON
@ ASCII__NEWLINE
@ ASCII__COLON
@ ASCII__RETURN
@ ASCII__QUESTION_MARK
static const Handle INVALID_Handle
BALL_INDEX_TYPE ErrorCode
static const Index INVALID_Index
int(* ComparatorType)(const void *, const void *)
BALL_SIZE_TYPE Position
static const Index Index_MAX
BALL_SIZE_TYPE Handle
static const Distance Distance_MIN
static const Distance Distance_MAX
static const Size Size_MIN
BALL_LONG64_TYPE LongIndex
static const Position Position_MAX
static const Index Index_MIN
static const Handle Handle_MAX
unsigned char Byte
BALL_INDEX_TYPE Distance
BALL_INDEX_TYPE Index
float Real