diff options
| author | Thomas Schmucker <ts@its1.de> | 2022-04-09 09:43:53 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2022-04-09 09:43:53 +0200 |
| commit | 154874afda4a8df885e51c01f7681f04fb0b8e61 (patch) | |
| tree | 274817eb2793584b0e3d856de5504a614f2b4e89 /util.h | |
| parent | 2863f4f1d2a6a6a8704454824d6c291d2e0d4b5c (diff) | |
| download | data-structures-154874afda4a8df885e51c01f7681f04fb0b8e61.tar.gz data-structures-154874afda4a8df885e51c01f7681f04fb0b8e61.tar.bz2 data-structures-154874afda4a8df885e51c01f7681f04fb0b8e61.zip | |
neue Verzeichnisstruktur
Diffstat (limited to 'util.h')
| -rw-r--r-- | util.h | 24 |
1 files changed, 0 insertions, 24 deletions
| @@ -1,24 +0,0 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <stdarg.h> | ||
| 4 | #include <stdio.h> | ||
| 5 | #include <stdlib.h> | ||
| 6 | |||
| 7 | static void | ||
| 8 | error(const char *msg, ...) | ||
| 9 | { | ||
| 10 | va_list ap; | ||
| 11 | |||
| 12 | va_start(ap, msg); | ||
| 13 | fprintf(stderr, "Error: "); | ||
| 14 | vfprintf(stderr, msg, ap); | ||
| 15 | va_end(ap); | ||
| 16 | fprintf(stderr, "\n"); | ||
| 17 | exit(EXIT_FAILURE); | ||
| 18 | } | ||
| 19 | |||
| 20 | #define ERROR(msg) error(msg " in \"%s()\" (%s:%d)", __func__, __FILE__, __LINE__) | ||
| 21 | |||
| 22 | #ifndef NELEM | ||
| 23 | # define NELEM(x) (sizeof(x) / sizeof(x[0])) /* NOLINT */ | ||
| 24 | #endif | ||
