diff options
| -rw-r--r-- | util.h | 9 |
1 files changed, 4 insertions, 5 deletions
| @@ -1,9 +1,9 @@ | |||
| 1 | #ifndef ITS1_UTIL_H_INCLUDED | 1 | #ifndef ITS1_UTIL_H_INCLUDED |
| 2 | #define ITS1_UTIL_H_INCLUDED | 2 | #define ITS1_UTIL_H_INCLUDED |
| 3 | 3 | ||
| 4 | #include <stdarg.h> | ||
| 4 | #include <stdio.h> | 5 | #include <stdio.h> |
| 5 | #include <stdlib.h> | 6 | #include <stdlib.h> |
| 6 | #include <stdarg.h> | ||
| 7 | 7 | ||
| 8 | #ifndef NDEBUG | 8 | #ifndef NDEBUG |
| 9 | static void | 9 | static void |
| @@ -19,14 +19,13 @@ error(const char *msg, ...) | |||
| 19 | exit(EXIT_FAILURE); | 19 | exit(EXIT_FAILURE); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | #define ERROR(msg) error(msg " in \"%s()\" (%s:%d)", __func__, __FILE__, __LINE__) | 22 | # define ERROR(msg) error(msg " in \"%s()\" (%s:%d)", __func__, __FILE__, __LINE__) |
| 23 | #else | 23 | #else |
| 24 | #define ERROR(msg) /**/ | 24 | # define ERROR(msg) /**/ |
| 25 | #endif | 25 | #endif |
| 26 | 26 | ||
| 27 | #ifndef NELEM | 27 | #ifndef NELEM |
| 28 | #define NELEM(x) (sizeof(x) / sizeof(x[0])) | 28 | # define NELEM(x) (sizeof(x) / sizeof(x[0])) /* NOLINT */ |
| 29 | #endif | 29 | #endif |
| 30 | 30 | ||
| 31 | #endif | 31 | #endif |
| 32 | |||
