12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #ifndef _sHT_BUGS_H
- #define _sHT_BUGS_H
- #include <stddef.h>
- #include <sys/types.h>
- #include <limits.h>
- #include <sHT/compiler.h>
- #define sHT_require(b) \
- do { \
- if (sHT_unlikely(!(b))) \
- sHT_halt(#b); \
- } while (0)
- #define sHT_assert(b) sHT_require(b)
- struct sHT_bug_option {
- const char *msg;
- int code;
- };
- __attribute__((cold)) __attribute__((nonnull (1)))
- _Noreturn void
- sHT_bug(const struct sHT_bug_option *options, int code);
- #define sHT_todo(b) do { if ((b)) __builtin_trap(); } while (0)
- #endif
|