summaryrefslogtreecommitdiff
path: root/tinyusb/common/compiler
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-03-04 15:01:33 +0700
committerhathach <[email protected]>2013-03-04 15:01:33 +0700
commit656da2992ded914c70da849f9f7a1571dd2b91f4 (patch)
tree3e00db7c1c2cf57276fd61ae833e54ff1ea67364 /tinyusb/common/compiler
parent5207875addf972f8323b51318975c6c6f3861dd4 (diff)
add alignof to compilier specific
add static_assert support for IAR (built-in support)
Diffstat (limited to 'tinyusb/common/compiler')
-rw-r--r--tinyusb/common/compiler/compiler_gcc.h2
-rw-r--r--tinyusb/common/compiler/compiler_iar.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/tinyusb/common/compiler/compiler_gcc.h b/tinyusb/common/compiler/compiler_gcc.h
index b778f6b92..ac0238a8e 100644
--- a/tinyusb/common/compiler/compiler_gcc.h
+++ b/tinyusb/common/compiler/compiler_gcc.h
@@ -51,6 +51,8 @@
extern "C" {
#endif
+#define ALIGN_OF(x) __alignof__(x)
+
/// Normally, the compiler places the objects it generates in sections like data or bss & function in text. Sometimes, however, you need additional sections, or you need certain particular variables to appear in special sections, for example to map to special hardware. The section attribute specifies that a variable (or function) lives in a particular section
#define ATTR_SECTION(section) __attribute__ ((#section))
diff --git a/tinyusb/common/compiler/compiler_iar.h b/tinyusb/common/compiler/compiler_iar.h
index 85f98deed..99a9005d8 100644
--- a/tinyusb/common/compiler/compiler_iar.h
+++ b/tinyusb/common/compiler/compiler_iar.h
@@ -51,6 +51,8 @@
extern "C" {
#endif
+#define ALIGN_OF(x) __ALIGNOF__(x)
+
#define ATTR_PREPACKED __packed
#define ATTR_PACKED