#ifndef SCFGCOMPILERS_H #define SCFGCOMPILERS_H /* https://gcc-renesas.com/migration-guides/rx/index.html#Compiler_directives https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html https://gcc.gnu.org/onlinedocs/gcc/RX-Function-Attributes.html https://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html */ #if defined(__CCRX__) /* supported */ #elif defined(__GNUC__) /* supported */ #else #error "Unrecognized compiler" #endif #define R_PRAGMA(...) _Pragma(#__VA_ARGS__) #if defined(__CCRX__) #define R_PRAGMA_PACK R_PRAGMA(pack) #define R_PRAGMA_PACKOPTION R_PRAGMA(packoption) #elif defined(__GNUC__) #define R_PRAGMA_PACK R_PRAGMA(pack(1)) #define R_PRAGMA_PACKOPTION R_PRAGMA(pack()) #endif #if defined(__CCRX__) #define R_PRAGMA_INTERRUPT(function_name, vector) R_PRAGMA(interrupt function_name(vect=vector))\ extern void function_name(void); #define R_PRAGMA_STATIC_INTERRUPT(function_name, vector) R_PRAGMA(interrupt function_name(vect=vector))\ static void function_name(void); //TODO: fast interrupt #elif defined(__GNUC__) #define R_PRAGMA_INTERRUPT(function_name, vector) extern void function_name(void) __attribute__((interrupt(".rvectors", vector))); #define R_PRAGMA_STATIC_INTERRUPT(function_name, vector) static void function_name(void) __attribute__((interrupt(".rvectors", vector), used)); //TODO: fast interrupt #endif #define R_ATTRIB_INLINE inline extern #define R_ATTRIB_STATIC_INLINE inline static #define R_PRAGMA_INLINE(function_prototype) R_ATTRIB_INLINE function_prototype; #define R_PRAGMA_STATIC_INLINE(function_prototype) R_ATTRIB_STATIC_INLINE function_prototype; #if defined(__CCRX__) /* nothing to do */ #elif defined(__GNUC__) #define __evenaccess /* none */ #endif /* https://gcc-renesas.com/migration-guides/rx/index.html#Compiler_predefined */ #if defined(__CCRX__) /* maybe nothing to do */ #elif defined(__GNUC__) #define __RX 1 #if defined(__RX_LITTLE_ENDIAN__) #define __LIT 1 #endif #if defined(__RX_BIG_ENDIAN__) #define __BIG 1 #endif #endif #endif /* SCFGCOMPILERS_H */