types by size - C header to define primative types by bit-width
$ meson build && cd build
$ meson test # optional, but highly recommended
$ sudo meson install # install headers
You can copy the inc/tbs/ directory into the appropriate include location if you insist on not using Meson.
pkgconfig files will not be made and tests will not be done.
uint, ulong typedef'd to unsigned int and unsigned long, respectively. Disabled by defining TBS_NO_GENERICS.
u8, u16, u32, u64 (u128 if supported by system, and if TBS_ALLOW_128_BIT_INTS is defined)
i8, i16, i32, i64 (i128 if supported by system, and if TBS_ALLOW_128_BIT_INTS is defined)
f32, f64, f80/f128 (float, double, and long double, respectively)
Avoid using f128, and especially f80, if you don't have a specific reason to.
Unless you are doing funny bithacks, it's pointless.
fMax, uMax, and iMax will be typedef'd to the widest respective type available
-
TBS_ARCHset to the detected cpu arch (seearch.h) -
TBS_WORDSIZEset to the wordsize, based onTBS_ARCH -
TBS_MAX_WIDTHnumber of bits inuMaxoriMax
| OS | arch | gcc | clang | g++ | clang++ |
|---|---|---|---|---|---|
| Arch Linux | x86_64 | X | X | X | X |
| Arch Linux | x86_32 | X | X | X | X |
| MacOS 12.4 | x86_64 | X | X | X | X |
| Debian 11 on CrOS | x86_64 | X | X | X | X |
[ ] add macros for printf sequences. eg. TBS_FMT_uMax would expand to %zu or %lu depending on the actual size.
[ ] better documentation; this is the laziest bare minumum shit currently lmfao
[ ] much more testing, especially on non-x86 machines