pfultz2/Cloak
View on GitHub ↗ ★ 989 C
A mini-preprocessor library to demostrate the recursive capabilites of the preprocessor
10 mentions on Hacker News by 8 people: 3 stories, 7 comments · first 2013-06-27 · latest 2026-03-28
20082026
-
▲ 3
C Preprocessor tricks, tips, and idiomsstory by signa11 · 2026-03-28 · 0 comments
-
…other preprocessors let you do that using builtins which are fast and easy to grok. See for example https://github.com/pfultz2/Cloak/wiki/C-Preprocessor-tricks,... Poor C preprocessor performance has a negative real world impact, for…
comment by skissane · 2024-09-03 · in Greppability is an underrated code metric -
…WHEN(IS_PAREN(args))(EXPAND(EXPAND args))) #define NO_ARGS Where cloak.h is https://github.com/pfultz2/Cloak/blob/master/cloak.h The above macros are admitttedly very hairy. If C had a better preprocessor, but was otherwise unchanged,
comment by skissane · 2023-06-24 · in Object-oriented Programming with ANSI-C (1993) [pdf] -
…end up unintentionally upsetting some people with it. [0] https://github.com/scallyw4g/poof [1] https://github.com/pfultz2/Cloak/wiki/C-Preprocessor-tricks,...
comment by skissane · 2023-04-17 · in Plain C API design, the real world Kobayashi Maru test -
Well, mostly I use idioms from the Cloak Wiki ( https://github.com/pfultz2/Cloak/wiki/C-Preprocessor-tricks,... ). It takes some time to realise them :)
comment by Hirrolot · 2021-02-04 · in Datatype99: C99 with Sum Types, v0.1.0 -
▲ 78
C preprocessor tricks, tips, and idioms (2015)story by Pete_D · 2019-08-23 · 12 comments
-
…it. Regardless, here's a link that seems to cover this and other somewhat more obscure techniques: https://github.com/pfultz2/Cloak/wiki/C-Preprocessor-tricks,...
comment by yoklov · 2016-02-29 · in C preprocessor tips and tricks -
…an excellent guide on recursion in macros, see this article on how to abuse the C pre-processor: https://github.com/pfultz2/Cloak/wiki/C-Preprocessor-tricks,... . In the end I end up defining structs like this: SERIALIZER_STRUCT(…
comment by asteadman · 2015-10-13 · in Struct Iteration Through Abuse of the C Preprocessor -
…x = y; \ y = x##y; \ } Also, you can be tricky and "co-recurse" in macros, which is explained here: https://github.com/pfultz2/Cloak/wiki/C-Preprocessor-tricks,... Regarding each-it, I think its pretty doable in C. Right off the top of my…
comment by tolmasky · 2014-09-15 · in Comparative Macrology -
▲ 16
C Preprocessor tricks, tips, and idiomsstory by nkurz · 2013-06-27 · 0 comments