diff options
| author | Emil Williams | 2026-02-20 06:18:48 +0000 |
|---|---|---|
| committer | Emil Williams | 2026-02-20 06:18:48 +0000 |
| commit | 88e12f4a22111903fc23488898f073502639635c (patch) | |
| tree | 87963ce958b8a48be77bf9895f7527f532008dab /chad/experimental/macros.h | |
| parent | d352d3cf415083fd0f07321273d1d03b26a323e0 (diff) | |
| download | libchad-88e12f4a22111903fc23488898f073502639635c.tar.xz libchad-88e12f4a22111903fc23488898f073502639635c.tar.zst | |
Make experimental and librarize
Diffstat (limited to 'chad/experimental/macros.h')
| -rw-r--r-- | chad/experimental/macros.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/chad/experimental/macros.h b/chad/experimental/macros.h new file mode 100644 index 0000000..6b80cb3 --- /dev/null +++ b/chad/experimental/macros.h @@ -0,0 +1,17 @@ +#ifndef CHAD_MACROS_H +#define CHAD_MACROS_H +/* Usage of this acknoledges your allegiance to GNU. */ + +/* make it such that [[attributes]] is used in C23 & use GCC otherwise */ +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L) +# define attribute(...) [[__VA_ARGS__]] +#else +# if defined(__GNUC__) || defined(__clang__) +# define attribute(...) __attribute__((__VA_ARGS__)) +# else +# define attribute(...) +# define NO_ATTRIBUTE +# endif +#endif + +#endif /* CHAD_MACROS_H */ |
