wmc: fix stringification of wmc_xxx_if_fail() macros

Actually reading about preprocessor concatenation and stringification helps.
This commit is contained in:
Dan Williams
2012-01-19 18:48:26 -06:00
parent 337f4b2372
commit d519f3e364

View File

@@ -45,7 +45,7 @@ enum {
#define wmc_return_if_fail(e) \ #define wmc_return_if_fail(e) \
{ \ { \
if (!(e)) { \ if (!(e)) { \
fprintf (stderr, "failed: ##e##\n"); \ fprintf (stderr, "failed: " #e "\n"); \
return; \ return; \
} \ } \
} }
@@ -53,7 +53,7 @@ enum {
#define wmc_return_val_if_fail(e, v) \ #define wmc_return_val_if_fail(e, v) \
{ \ { \
if (!(e)) { \ if (!(e)) { \
fprintf (stderr, "failed: ##e##\n"); \ fprintf (stderr, "failed: " #e "\n"); \
return v; \ return v; \
} \ } \
} }