cosmopolitan/tool/plinko/lib/trace.h
Justine Tunney fa20edc44d
Reduce header complexity
- Remove most __ASSEMBLER__ __LINKER__ ifdefs
- Rename libc/intrin/bits.h to libc/serialize.h
- Block pthread cancelation in fchmodat() polyfill
- Remove `clang-format off` statements in third_party
2023-11-28 14:39:42 -08:00

38 lines
1.1 KiB
C

#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_TRACE_H_
#define COSMOPOLITAN_TOOL_PLINKO_LIB_TRACE_H_
#include "libc/str/str.h"
COSMOPOLITAN_C_START_
#define START_TRACE \
bool t; \
PairFn *pf; \
BindFn *bf; \
EvlisFn *ef; \
RecurseFn *rf; \
TailFn *tails[8]; \
EvalFn *ev, *ex; \
memcpy(tails, kTail, sizeof(kTail)); \
ev = eval; \
bf = bind_; \
ef = evlis; \
ex = expand; \
pf = pairlis; \
rf = recurse; \
EnableTracing(); \
t = trace; \
trace = true
#define END_TRACE \
trace = t; \
eval = ev; \
bind_ = bf; \
evlis = ef; \
expand = ex; \
pairlis = pf; \
recurse = rf; \
memcpy(kTail, tails, sizeof(kTail))
void EnableTracing(void);
COSMOPOLITAN_C_END_
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_TRACE_H_ */