Skip to content

Commit

Permalink
make __always_inline compatible with older gcc versions; replace inli…
Browse files Browse the repository at this point in the history
…ne __always_inline in USBComposite library
  • Loading branch information
arpruss committed Aug 9, 2018
1 parent 6791e79 commit 03184ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion STM32F1/libraries/USBComposite/usb_composite_serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ int composite_cdcacm_get_n_data_bits(void); /* bDataBits */

void composite_cdcacm_set_hooks(unsigned hook_flags, void (*hook)(unsigned, void*));

static inline __always_inline void composite_cdcacm_remove_hooks(unsigned hook_flags) {
static __always_inline void composite_cdcacm_remove_hooks(unsigned hook_flags) {
composite_cdcacm_set_hooks(hook_flags, 0);
}

Expand Down
6 changes: 5 additions & 1 deletion STM32F1/system/libmaple/include/libmaple/libmaple_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ typedef void (*voidArgumentFuncPtr)(void *);
#define __deprecated __attribute__((__deprecated__))
#define __weak __attribute__((weak))
#ifndef __always_inline
#define __always_inline __attribute__((always_inline))
#if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800)
#define __always_inline __inline__ __attribute__((__always_inline__))
#else
#define __always_inline
#endif
#endif
#ifndef __unused
#define __unused __attribute__((unused))
Expand Down

0 comments on commit 03184ad

Please sign in to comment.