types.h 610 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "size.h"
  3. #include "status.h"
  4. #include "stdint.h"
  5. #define __user
  6. #ifdef __GNUC__
  7. #define NORETURN __attribute__((noreturn))
  8. #else
  9. #error "no definition for ((NORETURN))"
  10. #endif
  11. #ifdef __GNUC__
  12. #define SECTION(x) __attribute__((section(x)))
  13. #else
  14. #error "no definition for ((SECTION))"
  15. #endif
  16. #ifdef __GNUC__
  17. #define likely(expr) (__builtin_expect(!!(expr), 1))
  18. #define unlikely(expr) (__builtin_expect(!!(expr), 0))
  19. #else
  20. #define likely(expr) (!!(expr))
  21. #define unlikely(expr) (!!(expr))
  22. #endif
  23. #ifdef __cplusplus
  24. #include <types/allocator.hpp>
  25. #include <types/cplusplus.hpp>
  26. #endif