summaryrefslogtreecommitdiffstatshomepage
path: root/stm
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-02-16 11:24:44 +0000
committerDamien George <damien.p.george@gmail.com>2014-02-16 11:24:44 +0000
commit8bb11171da32f893eaee39ae54fad7166fd7efdb (patch)
treec784bb0dc3332902db5450753dc75a2d04e020ee /stm
parent5fd7bc32645b6f0d1e818244a7330908c1d25057 (diff)
downloadmicropython-8bb11171da32f893eaee39ae54fad7166fd7efdb.tar.gz
micropython-8bb11171da32f893eaee39ae54fad7166fd7efdb.zip
stm: Only define __packed if not already defined.
Addresses issue #299.
Diffstat (limited to 'stm')
-rw-r--r--stm/stmusb/usb_conf.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/stm/stmusb/usb_conf.h b/stm/stmusb/usb_conf.h
index 5856899d59..1ae7135180 100644
--- a/stm/stmusb/usb_conf.h
+++ b/stm/stmusb/usb_conf.h
@@ -293,7 +293,9 @@
#elif defined (__ICCARM__) /* IAR Compiler */
#define __packed __packed
#elif defined ( __GNUC__ ) /* GNU Compiler */
- #define __packed __attribute__ ((__packed__))
+ #ifndef __packed /* dpgeorge: add check for already defined symbol, since some compilers define it in cdefs.h */
+ #define __packed __attribute__ ((__packed__))
+ #endif
#elif defined (__TASKING__) /* TASKING Compiler */
#define __packed __unaligned
#endif /* __CC_ARM */