Missing braces arround extern declarartions in __SET_EXTERNAL define was making problem with GCC in switch case statements
authoredouard
Sat, 18 May 2013 16:35:41 +0900
changeset 819 5aef7d20b0fc
parent 818 2a3f34967cae
child 820 62b55ca5b879
Missing braces arround extern declarartions in __SET_EXTERNAL define was making problem with GCC in switch case statements
lib/accessor.h
--- a/lib/accessor.h	Thu May 16 14:37:33 2013 +0900
+++ b/lib/accessor.h	Sat May 18 16:35:41 2013 +0900
@@ -105,9 +105,9 @@
 #define __SET_VAR(prefix, name, new_value, ...)\
 	if (!(prefix name.flags & __IEC_FORCE_FLAG)) prefix name.value __VA_ARGS__ = new_value
 #define __SET_EXTERNAL(prefix, name, new_value, ...)\
-	extern IEC_BYTE __IS_GLOBAL_##name##_FORCED();\
+	{extern IEC_BYTE __IS_GLOBAL_##name##_FORCED();\
     if (!(prefix name.flags & __IEC_FORCE_FLAG || __IS_GLOBAL_##name##_FORCED()))\
-		(*(prefix name.value)) __VA_ARGS__ = new_value
+		(*(prefix name.value)) __VA_ARGS__ = new_value;}
 #define __SET_EXTERNAL_FB(prefix, name, new_value, ...)\
 	__SET_VAR((*(prefix name)), __VA_ARGS__, new_value)
 #define __SET_LOCATED(prefix, name, new_value, ...)\