From 011972e323f133dd4ac8e3c76ebf7c7cede78587 Mon Sep 17 00:00:00 2001 From: Henrik Stickann <4376396-Mithradir@users.noreply.gitlab.com> Date: Thu, 31 Mar 2022 18:11:33 +0200 Subject: [PATCH] Add compiler feature macros --- include/sta/lang.hpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 include/sta/lang.hpp diff --git a/include/sta/lang.hpp b/include/sta/lang.hpp new file mode 100644 index 0000000..07ac63c --- /dev/null +++ b/include/sta/lang.hpp @@ -0,0 +1,34 @@ +#ifndef STA_LANG_HPP +#define STA_LANG_HPP + + +#ifndef STA_ASM +# define STA_ASM __asm +#endif // STA_ASM + +#ifndef STA_DEPRECATED +# define STA_DEPRECATED __attribute__((deprecated)) +#endif // STA_DEPRECATED + +#ifndef STA_WEAK +# define STA_WEAK __attribute__((weak)) +#endif // STA_WEAK + +#ifndef STA_PACKED +# define STA_PACKED __attribute__((packed)) +#endif // STA_PACKED + +#ifndef STA_PACKED_STRUCT +# define STA_PACKED_STRUCT struct STA_PACKED +#endif // STA_PACKED_STRUCT + +#ifndef STA_PACKED_UNION +# define STA_PACKED_UNION union STA_PACKED +#endif // STA_PACKED_UNION + +#ifndef STA_BKPT +# define STA_BKPT(value) STA_ASM volatile ("bkpt "#value) +#endif // STA_BKPT + + +#endif // STA_LANG_HPP