diff --git a/README.md b/README.md index a985e82df422f56066af2ea273ace806faca7c08..009af3f4d82296db5ccdb0a67daeb0111bd50d8c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ > [!IMPORTANT] > There are more involved libraries out there providing better granularity > and functionality. This library is intended for ease of use first and -> foremost. It is not a replacement for those libraries. +> foremost. It is not a replacement for those libraries. Use at your own risk. ## Features @@ -220,3 +220,7 @@ ```bash make test ``` + +## Acknowledgments + +- https://github.com/tsoding/nob.h \ No newline at end of file diff --git a/nonstd.h b/nonstd.h index f4f62926284900688890e17c52905d0286d54d27..3e39380e7edf59c3af8515e177b80e42d0310e52 100644 --- a/nonstd.h +++ b/nonstd.h @@ -60,7 +60,18 @@ #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define CLAMP(x, lo, hi) (MIN((hi), MAX((lo), (x)))) -#define UNUSED(x) (void)(x) +// From https://github.com/tsoding/nob.h/blob/e2c9a46f01d052ab740140e74453665dc3334832/nob.h#L205-L206. +#define UNUSED(value) (void)(value) +#define TODO(message) \ + do { \ + fprintf(stderr, "%s:%d: TODO: %s\n", __FILE__, __LINE__, message); \ + abort(); \ + } while (0) +#define UNREACHABLE(message) \ + do { \ + fprintf(stderr, "%s:%d: UNREACHABLE: %s\n", __FILE__, __LINE__, message); \ + abort(); \ + } while (0) #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #define STATIC_ASSERT(expr, msg) _Static_assert((expr), msg)