vrcore  0.45
visuReal Messkern
 All Classes Files Functions Variables
defines.h
1 #pragma once
2 
3 typedef int StatusValue;
4 
5 typedef double DblVec [2];
6 typedef DblVec* LpDblVec;
7 
8 const double dPi = 3.1415926535897932384626433832795;
9 const float fPi = 3.14159265358979323846f;
10 
11 #ifdef _WIN64
12  typedef int HALF_PTR;
13 #else
14  typedef short HALF_PTR;
15 #endif
16 
17 #ifndef MIN
18 #define MIN(a,b) ((a) > (b) ? (b) : (a))
19 #endif
20 
21 #ifndef MAX
22 #define MAX(a,b) ((a) < (b) ? (b) : (a))
23 #endif
24 
25 #ifndef RANGE
26 #define RANGE(rL, rV, rR) ( MIN (rR, MAX (rV, rL)) )
27 #define INRANGE(rL, rV, rR) (rL <= rV && rV < rR)
28 #endif
29 
30 #ifndef ABSDIF
31 #define ABSDIF(a, b) ( std::abs (a - b) )
32 #endif
33 
34 #ifndef ABSDIFCUT
35 #define ABSDIFCUT(a, b, c) ( MAX (0, std::abs (a - b) - c) )
36 #endif
37 
38 #ifndef SETBIT
39 #define SETBIT(val, n) ((n < sizeof (val) * 8) ? ((n < 32) ? (val | (1 << n)) : (val | (1ll << n))) : val)
40 #define ISBIT(val, n) ((n < sizeof (val) * 8) ? ((n < 32) ? (val & (1 << n)) != 0 : (val & (1ll << n)) != 0) : false)
41 #define CLEARBIT(val, n) ((n < sizeof (val) * 8) ? ((n < 32) ? ((val | (1 << n)) ^ (1 << n)) : ((val | (1 << n)) ^ (1ll << n))) : val)
42 #endif
43 
44 #define ASBOOLSTR(b) (b ? "True" : "False")
45 
46 #ifndef WIN32_DEBUG
47 #ifdef WIN32
48 #ifdef _DEBUG
49 #define WIN32_DEBUG
50 #endif
51 #endif
52 #endif