]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/safe/include/annots_stage1.h
move annotations to nesC
[tinyos-2.x.git] / tos / lib / safe / include / annots_stage1.h
index 44d24463bce2f5ca7723eba90358e9a0408d4b70..30028c1587a2df2e2d2d08812ad53cf2f086ce3a 100644 (file)
@@ -1,39 +1,33 @@
+/* Keep TinyOS happy with pre 1.3.0 nesC's */
+
 #ifndef ANNOTS_STAGE1_INCLUDED
 #define ANNOTS_STAGE1_INCLUDED
 
-#if NESC >= 130 && defined(SAFE_TINYOS)
-
-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") { }; 
-
-#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
 
-#else // NESC < 130
+#if NESC < 130 
 
-#ifdef SAFE_TINYOS
-#error Safe TinyOS requires nesC >= 1.3.0
-#endif
+#define __DEPUTY_UNUSED__                      __attribute__((unused))
 
-#define COUNT(x)                               
-#define BOUND(x,y)                             
-#define SINGLE                                 
 #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
 
-#endif 
+#define TCAST(__type,__expr)                   ((__type)(__expr))                
 
 #ifdef SAFE_TINYOS
+#warning Safe TinyOS requires nesC >= 1.3.0
+#endif
 
-#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 
-
-#endif // ANNOTS_STAGE1_INCLUDED
+#endif // NESC version check
 
+#endif