Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Avoid multiple declaration on the same line/statement
[simgrid.git] / include / xbt / swag.h
index fa96ed4d7dd6382c9238d18ec5e43bb21c066f57..2431b3088c25be5a89a7d20f37a2a948b8cc43eb 100644 (file)
@@ -65,12 +65,15 @@ typedef struct foo {
 */
 typedef s_xbt_swag_hookup_t *xbt_swag_hookup_t;
 
-typedef struct xbt_swag {
+struct xbt_swag {
   void *head;
   void *tail;
   size_t offset;
   int count;
-} s_xbt_swag_t, *xbt_swag_t;
+};
+typedef struct xbt_swag  s_xbt_swag_t;
+typedef struct xbt_swag* xbt_swag_t;
+
 /**< A typical swag */
 /* @} */
 
@@ -189,4 +192,16 @@ static inline void *xbt_swag_getFirst(xbt_swag_t swag)
 /* @} */
 
 SG_END_DECL()
+
+#ifdef __cplusplus
+namespace simgrid {
+namespace xbt {
+  inline void destroy(xbt_swag_t s)
+  {
+    xbt_swag_free(s);
+  }
+}
+}
+#endif
+
 #endif                          /* _XBT_SWAG_H */