arocc
arocc copied to clipboard
Preprocessor: Macro expansion halted early
I'm not entirely sure what's going on with this one - I think possibly expanded __VA_ARGS__ should have their hidesets cleared?
GCC and clang produce F_HOOK ()(XXX); arocc produces F_PROGRESS(XX). Expanding that one more time results in the GCC/clang output.
#define F(acc) F_PROGRESS(acc)
#define F_PROGRESS(acc) CONTINUE(F)(acc##X)
#define F_HOOK() F
#define UNROLL(...) __VA_ARGS__
#define DEFER(op) op EMPTY
#define EMPTY
#define CONTINUE(k) DEFER(k##_HOOK)()
UNROLL(F_PROGRESS(X))