the gcc preprocessor allows:
#define macro(foo, args...)
Here is the version I use in drivers/sound/wavefront.c:
#ifdef WF_DEBUG
/* Thank goodness for gcc's preprocessor ... */
#define DPRINT(cond, format, args...) \
if ((dev.debug & (cond)) == (cond)) { \
printk (KERN_DEBUG LOGNAME format, ## args); \
}
#else
#define DPRINT(cond, format, args...)
#endif
and it works very nicely. i discovered this feature completely
randomly, so i thought i'd just pass it along, in case others are in
the dark. its a very obvious thing to be able to do, and gets rid of
some horrendous macro systems of the past.
--p
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/