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)
91template <
unsigned ctr>
100template <
unsigned ctr>
101inline 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) \
113void inline set_##NAME(bool val) \
115 unsigned int& cwd = GET_T_CWD; \
121inline unsigned int do_##NAME() \
123 const unsigned int cwd = GET_T_CWD; \
127#define CWD_CTRL_DISABLED(NAME) \
128void inline set_##NAME(bool val) \
131 fprintf(stderr, "TBCI warning: Attempt to set " #NAME ", which is disabled.\n"); \
133inline unsigned int do_##NAME() \
138#ifdef TBCI_NO_ERRCHECK
#define _TBCI_FLAG_ERRCHECK
#define _TBCI_FLAG_EXPCHECK
#define _TBCI_FLAG_EXCEPT
unsigned int tbci_control
#define _TBCI_FLAG_EXACTSUM2
#define CWD_CTRL_DISABLED(NAME)
#define CWD_CTRL_FCTS(NAME, FLAG)
#define _TBCI_FLAG_EXACTSUM
#define _TBCI_CWD_DEFAULT