tool-macro.h 774 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef AFUN_TOOL_MACRO_H
  2. #define AFUN_TOOL_MACRO_H
  3. #ifdef __cplusplus
  4. #define AFUN_STATIC [[maybe_unused]] static
  5. #define AFUN_INLINE [[maybe_unused]] inline
  6. #else
  7. #ifdef _MSC_VER
  8. #define AFUN_STATIC static
  9. #define AFUN_INLINE inline
  10. #else
  11. #define AFUN_STATIC __attribute__((unused)) static
  12. #define AFUN_INLINE __attribute__((unused)) inline
  13. #endif
  14. #endif
  15. #define AFUN_NULL ((void)0)
  16. #ifdef __cplusplus
  17. #ifdef AFUN_TOOL_C
  18. #define AFUN_TOOL_C_EXPORT_FUNC extern "C"
  19. #define AFUN_TOOL_C_EXPORT_VAR extern "C"
  20. #else
  21. #define AFUN_TOOL_C_EXPORT_FUNC AFUN_TOOL_EXPORT
  22. #define AFUN_TOOL_C_EXPORT_VAR AFUN_TOOL_EXPORT extern
  23. #endif
  24. #else
  25. #define AFUN_TOOL_C_EXPORT_FUNC AFUN_TOOL_EXPORT
  26. #define AFUN_TOOL_C_EXPORT_VAR AFUN_TOOL_EXPORT extern
  27. #endif
  28. #endif //AFUN_TOOL_MACRO_H