From 4440251d787edcae2ec1c4f55a204aa291bc3d93 Mon Sep 17 00:00:00 2001 From: pbrier Date: Sat, 6 Apr 2013 15:50:57 +0200 Subject: [PATCH 1/2] Added __packed macro to be compatible with GCC compiler, in order to build USB libs with GCC_ARM --- libraries/USBDevice/USBDevice/USBHAL.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/USBDevice/USBDevice/USBHAL.h b/libraries/USBDevice/USBDevice/USBHAL.h index c9c047e3b2b..a6464ab7f6f 100644 --- a/libraries/USBDevice/USBDevice/USBHAL.h +++ b/libraries/USBDevice/USBDevice/USBHAL.h @@ -22,6 +22,10 @@ #include "mbed.h" #include "USBEndpoints.h" +#ifdef __GNUC__ +#define __packed __attribute__ ((__packed__)) +#endif + class USBHAL { public: /* Configuration */ From 13ef536d3f0b6da7631e6c125f3bfae45f639188 Mon Sep 17 00:00:00 2001 From: pbrier Date: Thu, 11 Apr 2013 22:26:32 +0200 Subject: [PATCH 2/2] Fix for USB device compiling with GCC toolchain, adding __packed macro in toolchain.h, and including toolchain.h in mbed.h --- libraries/mbed/capi/toolchain.h | 5 +++++ libraries/mbed/cpp/mbed.h | 1 + 2 files changed, 6 insertions(+) diff --git a/libraries/mbed/capi/toolchain.h b/libraries/mbed/capi/toolchain.h index 69a4ddd87b7..bb83e169c33 100644 --- a/libraries/mbed/capi/toolchain.h +++ b/libraries/mbed/capi/toolchain.h @@ -32,4 +32,9 @@ typedef int FILEHANDLE; # define PACKED __attribute__((packed)) #endif + +#ifdef __GNUC__ +#define __packed __attribute__ ((__packed__)) +#endif + #endif diff --git a/libraries/mbed/cpp/mbed.h b/libraries/mbed/cpp/mbed.h index bba24a76dbe..e82fd970a45 100644 --- a/libraries/mbed/cpp/mbed.h +++ b/libraries/mbed/cpp/mbed.h @@ -18,6 +18,7 @@ #define MBED_LIBRARY_VERSION 30 +#include "toolchain.h" #include "platform.h" // Useful C libraries