]> 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 f6a71097a7ff877ed7dc704440143f60f18fde34..30028c1587a2df2e2d2d08812ad53cf2f086ce3a 100644 (file)
@@ -1,33 +1,33 @@
-#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
 
-#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 // NESC version check
+#define TCAST(__type,__expr)                   ((__type)(__expr))                
 
 #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))                
+#warning Safe TinyOS requires nesC >= 1.3.0
 #endif
 
+#endif // NESC version check
+
+#endif