| Revision: | 1.2 |
| Committed: | Mon Oct 18 14:11:42 2010 UTC (16 years ago) by sf-pippijn |
| Content type: | text/plain |
| Branch: | MAIN |
| Changes since 1.1: | +18 -0 lines |
| Log Message: | check and log but do not die when ncurses stuff fails |
| # | User | Rev | Content |
|---|---|---|---|
| 1 | sf-pippijn | 1.1 | #define GCC_VERSION(major,minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) |
| 2 | sf-pippijn | 1.2 | |
| 3 | #include "adt/foreach.h" | ||
| 4 | #include "adt/nullptr.h" | ||
| 5 | #include "adt/logs.h" | ||
| 6 | |||
| 7 | #define return_unless(cond) \ | ||
| 8 | do { \ | ||
| 9 | if (!(cond)) \ | ||
| 10 | { LOG ("error") << #cond << '\n'; \ | ||
| 11 | return; } \ | ||
| 12 | } while (0) | ||
| 13 | |||
| 14 | #define return_val_unless(cond, val) \ | ||
| 15 | do { \ | ||
| 16 | if (!(cond)) \ | ||
| 17 | { LOG ("error") << #cond << '\n'; \ | ||
| 18 | return val; } \ | ||
| 19 | } while (0) |