diff options
| author | 2025-11-17 20:57:42 -0600 | |
|---|---|---|
| committer | 2025-11-17 20:57:42 -0600 | |
| commit | 2b44f885e97b0d8902014a5a61f6687fa2931dec (patch) | |
| tree | 9e3ecfb3858f33a3922f47bde8a2163d9deed95e /include/macros.h | |
| parent | build config + more plugin stuff (diff) | |
ignore this commit
Diffstat (limited to 'include/macros.h')
| -rw-r--r-- | include/macros.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/macros.h b/include/macros.h index 3702df7..b7a1bd2 100644 --- a/include/macros.h +++ b/include/macros.h @@ -3,10 +3,28 @@ #include "config.h" -#ifdef PTX_MODULE +#define UNUSED(...) ((void)((void) __VA_ARGS__)) +#define NO_OP_DECL _Static_assert(1, "") + +#ifdef __has_attribute +# if __has_attribute(unavailable) +# define PTX_UNAVAILABLE(_x) __attribute__((unavailable(_x))) +# define PTX_UNAVAILABLE_DEF(_x, _def) _def PTX_UNAVAILABLE(_x) +# else +# define PTX_UNAVAILABLE(_x) +# define PTX_UNAVAILABLE_DEF(_x, _def) /* definition hidden */ NO_OP_DECL +# endif +#else +# define PTX_UNAVAILABLE(_x) +# define PTX_UNAVAILABLE_DEF(_x, _def) /* definition hidden */ NO_OP_DECL +#endif + +#ifdef PTX_PLUGIN #define PTX_API PTX_IMPORT +#define PTX_INTERNAL(_def) PTX_UNAVAILABLE_DEF("internal API", _def) #else #define PTX_API PTX_EXPORT +#define PTX_INTERNAL(_def) _def #endif #endif /* include guard */ |
