21 #if defined(BASE_LIB) | defined(BASE2017_LIB)
22 # define BASE_EXPORT EXPORT_TAG
24 # define BASE_EXPORT IMPORT_TAG
31 using char16 = char16_t;
34 using uint8 = uint8_t;
35 using int16 = int16_t;
36 using uint16 = uint16_t;
37 using int32 = int32_t;
38 using uint32 = uint32_t;
40 using int64 =
long long int;
41 using uint64 =
unsigned long long int;
43 using int64 = int64_t;
44 using uint64 = uint64_t;
48 static constexpr int32 linuxOS = 2;
49 static constexpr int32 windowsOS = 1;
52 # define _EM_OVERFLOW FE_OVERFLOW
53 # define _EM_INVALID FE_INVALID
54 # define _EM_UNDERFLOW FE_UNDERFLOW
55 # define _EM_ZERODIVIDE FE_DIVBYZERO
56 inline unsigned doClearFP() {
57 int ret = fetestexcept(FE_ALL_EXCEPT);
58 feclearexcept(FE_ALL_EXCEPT);
61 # define _clearfp doClearFP
63 static constexpr int32 currentOS = linuxOS;
64 template <
typename T,
typename U>
65 constexpr
const U &osval(
const T &,
const U &lval) {
return lval; }
68 static constexpr int32 currentOS = windowsOS;
69 template <
typename T,
typename U>
70 constexpr
const T &osval(
const T &wval,
const U &) {
return wval; }
79 # define CHECK_FP_STATUS checkFPStatus(__FILE__,__LINE__)
80 # define CLEAR_FP_STATUS _clearfp()
82 # define CHECK_FP_STATUS __noop()
83 # define CLEAR_FP_STATUS __noop()
86 # define FP_S CHECK_FP_STATUS
88 # define FP_C CLEAR_FP_STATUS
91 BASE_EXPORT const char16 *checkFPStatus(
const char *file=0,uint32 line=0);
92 enum FloatingPointCheck { FloatingPointCheckOff, FloatingPointCheckWarning, FloatingPointCheckException };
93 BASE_EXPORT FloatingPointCheck floatingPointCheckStatus();
94 BASE_EXPORT void floatingPointCheckStatus(FloatingPointCheck fpc);
95 static constexpr
bool isCurrentOS(
int i) {
return i==currentOS; }
100 #define FOR(x,y) for (auto x=(y).begin();x!=(y).end();++x)
104 static constexpr
bool isDebugCompile =
false;
106 static constexpr
bool isDebugCompile =
true;
112 # define filesystem ERROR_USE_SHARED_FILESTORE_INSTEAD
Defines automatic generation of DLL exports and imports for each system supported.
uint32 TType
class type indicator
Definition: basedef.h:46
#define BASE_EXPORT
Definition: basedef.h:24