macro.h 942 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef VIRTUALMATH_MACRO_H
  2. #define VIRTUALMATH_MACRO_H
  3. #include <stdio.h>
  4. #include <inttypes.h>
  5. #include <stdint.h>
  6. #include <time.h>
  7. #include <assert.h>
  8. #include <errno.h>
  9. #include <math.h>
  10. #include <string.h>
  11. #include <stdlib.h>
  12. #include <stdarg.h>
  13. #include <sys/stat.h>
  14. #include <ctype.h>
  15. #include <setjmp.h>
  16. #include <signal.h>
  17. #include <wchar.h>
  18. #include <wctype.h>
  19. #include <locale.h>
  20. #include <getopt.h>
  21. #include <unistd.h>
  22. #include <dlfcn.h>
  23. #include <ffi.h>
  24. // 布尔逻辑的定义
  25. #define bool int
  26. #define true 1
  27. #define false 0
  28. #define NUL ((char)0)
  29. #define WNUL ((wchar_t)0)
  30. #ifdef NDEBUG
  31. #define errasert(e) ((void)0)
  32. #else
  33. #ifdef __assert_fail
  34. #define errasert(e) __assert_fail(#e, __FILE__, __LINE__, __ASSERT_FUNCTION)
  35. #elif defined(_assert)
  36. #define errasert(e) _assert(#e, __FILE__, __LINE__)
  37. #else
  38. #define errasert(e) fprintf(stderr, "%s %s %s %s\n", #e, __FILE__, __LINE__)
  39. #endif
  40. #endif
  41. #endif //VIRTUALMATH_MACRO_H