Re:C Macro Tips and Tricks
by silentbicycle on Saturday January 01, 2011 @09:51AM
(#2057683)
For a contained example of many of these used appropriately, look at the source for libev (http://software.schmorp.de/pkg/libev.html). In particular, multiline macros and token pasting are used to generate generic interface functions for the different watcher structs.
The C preprocessor is powerful, but brittle. If Scheme's macros are hygienic, C's are pathogenic, so be judicious.
The C preprocessor is powerful, but brittle. If Scheme's macros are hygienic, C's are pathogenic, so be judicious.