commit 011972e323f133dd4ac8e3c76ebf7c7cede78587 Author: Henrik Stickann <4376396-Mithradir@users.noreply.gitlab.com> Date: Thu Mar 31 18:11:33 2022 +0200 Add compiler feature macros 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