descriptionC99 __VA_OPT__() alternative
last changeThu, 23 Apr 2026 19:08:26 +0000 (15:08 -0400)
content tags
readme

Almost fully C99 compatible ##__VA_ARGS__ and __VA_OPT__() alternative. The compiler needs to support empty __VA_ARGS__ (not to C99 spec) for this to work, though all compilers tested had no issue with that (even those with partial C99 support, like lacc)

Usage and hacking

Replace __VA_ARGS__ with VA_OPT_C(__VA_ARGS__):

#define prlog(f, ...) fprintf(stderr, f /* no comma here */ VA_OPT_C(__VA_ARGS__))

You can also define your own top level macro, I_MAKE_TEST() and the test macros themselves to add a lot more conditional functionality based on __VA_ARGS__ being empty or not.

shortlog
2026-04-23 gitrefine readme master
2026-04-22 gitinitial public commit
heads
7 weeks ago master