|
TR_datastructures 0.1.0
A generic C data structures library
|
Portable type definitions for C89/C99/C11 compatibility. More...
#include <limits.h>#include <stddef.h>Go to the source code of this file.
Macros | |
| #define | TR_STATIC_ASSERT(condition, message) typedef char tr_static_assert_##message[(condition) ? 1 : -1] |
| Compile time assertion macro. | |
| #define | NULL ((void *) 0) |
| Null pointer constant. | |
Enumerations | |
| enum | bool { false = 0 , true = 1 } |
| Boolean type. More... | |
Portable type definitions for C89/C99/C11 compatibility.
Provides fixed width integer types, bool, and NULL for use across all C standards. On C99 and later the standard headers are used directly. On C89 portable fallbacks are provided with compile time size verification.
| #define TR_STATIC_ASSERT | ( | condition, | |
| message | |||
| ) | typedef char tr_static_assert_##message[(condition) ? 1 : -1] |
Compile time assertion macro.
Triggers a compile error if condition is false. On C11 and later uses _Static_assert. On C89/C99 uses the array size trick.
| condition | Expression to evaluate at compile time |
| message | Token used as the error identifier — no spaces allowed |
Example usage:
| enum bool |