X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=cfg%2Fcompiler.h;h=028ef3ad57fafaeabedba505713993b3e18836de;hb=2be772f4027c5ea6ef0966d5aa0a6a3533dff9cc;hp=6eaf1482385ee71cf0c11ea78b470ffa246b6328;hpb=a3dd3cda2928dea1e658fba91599aed201606f54;p=bertos.git diff --git a/cfg/compiler.h b/cfg/compiler.h index 6eaf1482..028ef3ad 100755 --- a/cfg/compiler.h +++ b/cfg/compiler.h @@ -14,6 +14,18 @@ /*#* *#* $Log$ + *#* Revision 1.19 2006/04/11 00:07:33 bernie + *#* Implemenent MF_SAVESEL flag. + *#* + *#* Revision 1.18 2006/03/22 13:34:34 bernie + *#* MSVC support. + *#* + *#* Revision 1.17 2006/03/22 09:48:35 bernie + *#* Formatting. + *#* + *#* Revision 1.16 2006/03/20 17:48:09 bernie + *#* Fix for avr-libc; INTERRUPT(): Remove macro. + *#* *#* Revision 1.15 2006/03/13 02:06:25 bernie *#* containerof(): New macro. *#* @@ -190,6 +202,11 @@ /* MSVC doesn't support C99's __func__, but has a similar extension. */ #define __func__ __FUNCTION__ + /* MSVC doesn't support C99's inline keyword */ + #ifndef __cplusplus + #define INLINE __inline + #endif + #elif defined(__GNUC__) /* Compiler features */ @@ -227,7 +244,9 @@ #include #include #include + #if !CPU_AVR #include /* for ssize_t */ + #endif #ifndef __cplusplus /* @@ -315,9 +334,6 @@ #ifndef REGISTER #define REGISTER /* nothing */ #endif -#ifndef INTERRUPT -#define INTERRUPT(x) ERROR_NOT_IMPLEMENTED -#endif #ifndef LIKELY #define LIKELY(x) x #endif @@ -357,12 +373,14 @@ #define EXTERN_C extern "C" #define EXTERN_C_BEGIN extern "C" { #define EXTERN_C_END } - #define EXTERN_CONST extern const + #define EXTERN_CONST extern const + #define CONST_CAST(TYPE,EXPR) (const_cast(EXPR)) #else #define EXTERN_C extern #define EXTERN_C_BEGIN /* nothing */ #define EXTERN_C_END /* nothing */ - #define EXTERN_CONST const + #define EXTERN_CONST const + #define CONST_CAST(TYPE,EXPR) ((TYPE)(EXPR)) /* FIXME: How can we suppress the warning in C? */ #endif