Add a macro to count the number of args to a macro
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 20 Jul 2018 00:06:43 +0000 (20:06 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 20 Jul 2018 14:25:54 +0000 (10:25 -0400)
commit1e467e30c44ad56e0c63bd95afe104d71cd434c1
treeb07fd8dfce88d34d347ffa6bdd3b57bcdcd9e125
parentb778c95c529faba19efffaf688deab99b45cee0a
Add a macro to count the number of args to a macro

Usage:
assert(MACRO_NR_ARGS() == 0);
or:
#define foo(...) printk("Got %d\n", MACRO_NR_ARGS(__VA_ARGS__))

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/compiler.h