* \author Bernardo Innocenti <bernie@develer.com>
*/
-#ifndef DEVLIB_COMPILER_H
-#define DEVLIB_COMPILER_H
+#ifndef BERTOS_COMPILER_H
+#define BERTOS_COMPILER_H
#include <cpu/detect.h>
#define RESTRICT __restrict__
#define MUST_CHECK __attribute__((warn_unused_result))
#define PACKED __attribute__((packed))
+ /**
+ * Force compiler to realod context variable.
+ */
+ #define MEMORY_BARRIER asm volatile ("" : : : "memory")
+
#if GNUC_PREREQ(3,1)
#define DEPRECATED __attribute__((__deprecated__))
#endif
#pragma GCC poison cin cout cerr clog
#endif
+
+
#elif defined(__MWERKS__)
/* Compiler features */
#ifndef PACKED
#define PACKED /* nothing */
#endif
+#ifndef MEMORY_BARRIER
+#define MEMORY_BARRIER /* nothing */
+#warning No memory barrier defined for select compiler. If you use the kernel check it.
+#endif
/* Misc definitions */
#define EOF (-1)
#endif
-
/* Support for hybrid C/C++ applications. */
#ifdef __cplusplus
#define EXTERN_C extern "C"
do { (void)(&(var) == (type *)0); } while(0)
#endif
-#endif /* DEVLIB_COMPILER_H */
+#endif /* BERTOS_COMPILER_H */
#define CPU_STACK_GROWS_UPWARD 0
#define CPU_SP_ON_EMPTY_SLOT 0
#define CPU_HARVARD 0
- /*
- * Force compiler to realod context variable.
- */
- #define CPU_MEMORY_BARRIER asm volatile ("" : : : "memory")
#ifdef __IAR_SYSTEMS_ICC__
#warning Check CPU_BYTE_ORDER