55 #include "tbci/basics.h"
62 #define _TBCI_FLAG_ERRCHECK 1
63 #define _TBCI_FLAG_EXPCHECK 2
64 #define _TBCI_FLAG_ABORT 4
65 #define _TBCI_FLAG_EXCEPT 8
66 #define _TBCI_FLAG_EXACTSUM 16
67 #define _TBCI_FLAG_EXACTSUM2 32
69 #define _TBCI_CWD_DEFAULT (_TBCI_FLAG_ERRCHECK | _TBCI_FLAG_EXPCHECK | _TBCI_FLAG_EXCEPT)
91 template <
unsigned ctr>
100 template <
unsigned ctr>
101 inline unsigned int& tbci_params()
103 static tbci_par<ctr> settings;
106 #define GET_T_CWD tbci_params<0>()
109 #define GET_T_CWD tbci_control
112 #define CWD_CTRL_FCTS(NAME, FLAG) \
113 void inline set_##NAME(bool val) \
115 unsigned int& cwd = GET_T_CWD; \
121 inline unsigned int do_##NAME() \
123 const unsigned int cwd = GET_T_CWD; \
127 #define CWD_CTRL_DISABLED(NAME) \
128 void inline set_##NAME(bool val) \
131 fprintf(stderr, "TBCI warning: Attempt to set " #NAME ", which is disabled.\n"); \
133 inline unsigned int do_##NAME() \
138 #ifdef TBCI_NO_ERRCHECK
143 #ifndef TBCI_EXPCHECK
#define _TBCI_CWD_DEFAULT
unsigned int tbci_control
#define _TBCI_FLAG_EXACTSUM
#define _TBCI_FLAG_EXPCHECK
#define CWD_CTRL_FCTS(NAME, FLAG)
#define _TBCI_FLAG_EXCEPT
#define _TBCI_FLAG_ERRCHECK
#define _TBCI_FLAG_EXACTSUM2
#define CWD_CTRL_DISABLED(NAME)