Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: compiler_abstraction.h
- Revision:
- 11:8ffa8a36126f
- Parent:
- 3:ae1f53883bc0
--- a/compiler_abstraction.h Fri Apr 05 08:31:05 2019 +0000 +++ b/compiler_abstraction.h Sat Apr 06 04:17:35 2019 +0000 @@ -35,92 +35,92 @@ /*lint ++flb "Enter library region" */ #if defined ( __CC_ARM ) - -#ifndef __ASM -#define __ASM __asm -#endif - -#ifndef __INLINE -#define __INLINE __inline -#endif - -#ifndef __WEAK -#define __WEAK __weak -#endif - -#ifndef __ALIGN -#define __ALIGN(n) __align(n) -#endif - -#define GET_SP() __current_sp() - + + #ifndef __ASM + #define __ASM __asm + #endif + + #ifndef __INLINE + #define __INLINE __inline + #endif + + #ifndef __WEAK + #define __WEAK __weak + #endif + + #ifndef __ALIGN + #define __ALIGN(n) __align(n) + #endif + + #define GET_SP() __current_sp() + #elif defined ( __ICCARM__ ) - -#ifndef __ASM -#define __ASM __asm -#endif - -#ifndef __INLINE -#define __INLINE inline -#endif - -#ifndef __WEAK -#define __WEAK __weak -#endif - -/* Not defined for IAR since it requires a new line to work, and C preprocessor does not allow that. */ -#ifndef __ALIGN -#define __ALIGN(n) -#endif - -#define GET_SP() __get_SP() - -#elif defined ( __GNUC__ ) + + #ifndef __ASM + #define __ASM __asm + #endif + + #ifndef __INLINE + #define __INLINE inline + #endif + + #ifndef __WEAK + #define __WEAK __weak + #endif -#ifndef __ASM -#define __ASM __asm -#endif - -#ifndef __INLINE -#define __INLINE inline -#endif - -#ifndef __WEAK -#define __WEAK __attribute__((weak)) -#endif - -#ifndef __ALIGN -#define __ALIGN(n) __attribute__((aligned(n))) -#endif - -#define GET_SP() gcc_current_sp() + /* Not defined for IAR since it requires a new line to work, and C preprocessor does not allow that. */ + #ifndef __ALIGN + #define __ALIGN(n) + #endif + + #define GET_SP() __get_SP() + +#elif defined ( __GNUC__ ) + + #ifndef __ASM + #define __ASM __asm + #endif + + #ifndef __INLINE + #define __INLINE inline + #endif + + #ifndef __WEAK + #define __WEAK __attribute__((weak)) + #endif + + #ifndef __ALIGN + #define __ALIGN(n) __attribute__((aligned(n))) + #endif + + #define GET_SP() gcc_current_sp() -static inline unsigned int gcc_current_sp(void) -{ - register unsigned sp __ASM("sp"); - return sp; -} - + static inline unsigned int gcc_current_sp(void) + { + register unsigned sp __ASM("sp"); + return sp; + } + #elif defined ( __TASKING__ ) - -#ifndef __ASM -#define __ASM __asm -#endif - -#ifndef __INLINE -#define __INLINE inline -#endif - -#ifndef __WEAK -#define __WEAK __attribute__((weak)) -#endif - -#ifndef __ALIGN -#define __ALIGN(n) __align(n) -#endif - -#define GET_SP() __get_MSP() - + + #ifndef __ASM + #define __ASM __asm + #endif + + #ifndef __INLINE + #define __INLINE inline + #endif + + #ifndef __WEAK + #define __WEAK __attribute__((weak)) + #endif + + #ifndef __ALIGN + #define __ALIGN(n) __align(n) + #endif + + #define GET_SP() __get_MSP() + #endif /*lint --flb "Leave library region" */