From 12929a5877c61eebe57d49d2f3f62fe0c745b7c6 Mon Sep 17 00:00:00 2001 From: regehr Date: Sun, 17 Feb 2008 22:45:27 +0000 Subject: [PATCH 1/1] protect against multiple inclusion --- tos/lib/safe/include/annots_stage1.h | 10 ++++++++-- tos/lib/safe/include/annots_stage2.h | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tos/lib/safe/include/annots_stage1.h b/tos/lib/safe/include/annots_stage1.h index f6a71097..03e5f8d3 100644 --- a/tos/lib/safe/include/annots_stage1.h +++ b/tos/lib/safe/include/annots_stage1.h @@ -1,3 +1,6 @@ +#ifndef ANNOTS_STAGE1_INCLUDED +#define ANNOTS_STAGE1_INCLUDED + #if NESC >= 130 struct @bound @deputy_scope() @macro("__DEPUTY_BOUND") { void *lo, *hi; }; @@ -21,13 +24,16 @@ struct @nonnull @deputy_scope() @macro("__DEPUTY_NONNULL") { }; #define SINGLE #define NONNULL -#endif // NESC version check +#endif #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 +#endif + +#endif // ANNOTS_STAGE1_INCLUDED diff --git a/tos/lib/safe/include/annots_stage2.h b/tos/lib/safe/include/annots_stage2.h index b3270224..976bcc76 100644 --- a/tos/lib/safe/include/annots_stage2.h +++ b/tos/lib/safe/include/annots_stage2.h @@ -1,3 +1,6 @@ +#ifndef ANNOTS_STAGE2_INCLUDED +#define ANNOTS_STAGE2_INCLUDED + #ifdef SAFE_TINYOS #define __DEPUTY_BOUND(__lo,__hi) __attribute__((bounds((__lo),(__hi)))) @@ -6,7 +9,7 @@ #define __DEPUTY_NONNULL(__n) __attribute__((nonnull)) #define __DEPUTY_TRUSTEDBLOCK __blockattribute__((trusted)) -#else +#else #define __DEPUTY_BOUND(__lo,__hi) #define __DEPUTY_COUNT(__n) @@ -14,4 +17,7 @@ #define __DEPUTY_NONNULL(__n) #define __DEPUTY_TRUSTEDBLOCK -#endif +#endif + +#endif + -- 2.39.2