+#else
+#define xbt_swag_foreach(obj,swag) \
+ for((obj)=(decltype(obj)) xbt_swag_getFirst((swag)); \
+ (obj)!=NULL; \
+ (obj)=(decltype(obj)) xbt_swag_getNext((obj),(swag)->offset))
+#endif
+/**
+ * @brief A safe swag iterator
+ * @param obj the indice of the loop
+ * @param obj_next the object that is right after (if any) \a obj in the swag
+ * @param swag what to iterate over
+ * @hideinitializer
+
+ You can safely modify the \a swag while using this loop.
+ Well, safely... Err. You can remove \a obj without having any trouble at least. */
+
+#ifndef __cplusplus
+
+#define xbt_swag_foreach_safe(obj,obj_next,swag) \
+ for((obj)=xbt_swag_getFirst((swag)), \
+ ((obj)?(obj_next=xbt_swag_getNext((obj),(swag)->offset)): \
+ (obj_next=NULL)); \
+ (obj)!=NULL; \
+ (obj)=obj_next, \
+ ((obj)?(obj_next=xbt_swag_getNext((obj),(swag)->offset)): \
+ (obj_next=NULL)) )
+
+#else
+
+#define xbt_swag_foreach_safe(obj,obj_next,swag) \
+ for((obj) = (decltype(obj)) xbt_swag_getFirst((swag)), \
+ ((obj)?(obj_next = (decltype(obj)) xbt_swag_getNext((obj),(swag)->offset)): \
+ (obj_next=NULL)); \
+ (obj) != NULL; \
+ (obj) = obj_next, \
+ ((obj)?(obj_next = (decltype(obj)) xbt_swag_getNext((obj),(swag)->offset)): \
+ (obj_next=NULL)) )
+
+#endif
+
+/* @} */
+
+SG_END_DECL()
+
+#endif /* XBT_SWAG_H */