-#if NESC >= 130
+/* Keep TinyOS happy with pre 1.3.0 nesC's */
-struct @bound @deputy_scope() @macro("__DEPUTY_BOUND") { void *lo, *hi; };
-struct @count @deputy_scope() @macro("__DEPUTY_COUNT") { int n; };
-struct @single @deputy_scope() @macro("__DEPUTY_SINGLE") { };
-struct @nonnull @deputy_scope() @macro("__DEPUTY_NONNULL") { };
+#ifndef ANNOTS_STAGE1_INCLUDED
+#define ANNOTS_STAGE1_INCLUDED
-#define COUNT(x) @count(x)
-#define BOUND(x,y) @bound(x,y)
-#define SINGLE @single()
-#define NONNULL @nonnull()
+// define away two obsolete annotations
+#define BOUND(x,y)
+#define SINGLE
-#ifdef SAFE_TINYOS
-#define TCAST(__type,__expr) ((__type)((void * __DEPUTY_TRUSTED __DEPUTY_COPYTYPE)(__expr)))
-#define __DEPUTY_TRUSTED __attribute__((trusted))
-#define __DEPUTY_COPYTYPE __attribute__((copytype))
-#else
-#define TCAST(__type,__expr) ((__type)(__expr))
-#endif
+#if NESC < 130
+
+#define __DEPUTY_UNUSED__ __attribute__((unused))
-#else // NESC < 130
+#define NONNULL
+#define BND(x,y)
+#define BND_NOK(x,y)
+#define COUNT(x)
+#define COUNT_NOK(x)
+#define ONE
+#define ONE_NOK
+#define DMEMSET(x,y,z)
+#define DMEMCPY(x,y,z)
+#define TRUSTEDBLOCK
+
+#define TCAST(__type,__expr) ((__type)(__expr))
#ifdef SAFE_TINYOS
-#error Safe TinyOS requires nesC >= 1.3.0
+#warning Safe TinyOS requires nesC >= 1.3.0
#endif
+#endif // NESC version check
+
#endif