From fbbb63b166ebae5e25402e979498acd65c3039ac Mon Sep 17 00:00:00 2001 From: klueska Date: Thu, 27 Mar 2008 00:52:02 +0000 Subject: [PATCH] Update to allow header files to be processed via standard gcc and not have to run through ncc first (problem was in the usage of @combine, etc. in these files) --- tos/system/tos.h | 2 ++ tos/types/TinyError.h | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tos/system/tos.h b/tos/system/tos.h index 25ec7569..ec49a208 100644 --- a/tos/system/tos.h +++ b/tos/system/tos.h @@ -30,9 +30,11 @@ uint16_t TOS_NODE_ID = 1; transfer in interfaces. See TEP 3 for more discussion. */ #define PASS +#ifdef NESC struct @atmostonce { }; struct @atleastonce { }; struct @exactlyonce { }; +#endif /* This platform_bootstrap macro exists in accordance with TEP 107. A platform may override this through a platform.h file. */ diff --git a/tos/types/TinyError.h b/tos/types/TinyError.h index 02249bc2..c2ed2bfa 100644 --- a/tos/types/TinyError.h +++ b/tos/types/TinyError.h @@ -31,6 +31,12 @@ #ifndef TINY_ERROR_H_INCLUDED #define TINY_ERROR_H_INCLUDED +#ifdef NESC +#define NESC_COMBINE(x) @combine(x) +#else +#define NESC_COMBINE(x) +#endif + enum { SUCCESS = 0, FAIL = 1, // Generic condition: backwards compatible @@ -44,7 +50,7 @@ enum { EALREADY = 9, // The device state you are requesting is already set }; -typedef uint8_t error_t @combine("ecombine"); +typedef uint8_t error_t NESC_COMBINE("ecombine"); error_t ecombine(error_t r1, error_t r2) /* Returns: r1 if r1 == r2, FAIL otherwise. This is the standard error -- 2.39.2