]> AND Public Git Repository - simgrid.git/blobdiff - include/xbt/dynar.h
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / include / xbt / dynar.h
index 9ac385ff2028d79a6efc773998c04ef5ec49874c..83621209faa6f6a54c7330a537671652c8ee12d7 100644 (file)
@@ -26,7 +26,7 @@ SG_BEGIN_DECL()
   * structure creation (of type void_f_ppvoid_t or void_f_pvoid_t).
   *
   * \section XBT_dynar_exscal Example with scalar
-  * \dontinclude dynar.c
+  * \dontinclude dynar.cpp
   *
   * \skip Vars_decl
   * \skip dyn
@@ -203,7 +203,7 @@ typedef struct xbt_dynar_s {
   void_f_pvoid_t free_f;
 } s_xbt_dynar_t;
 
-static XBT_INLINE int _xbt_dynar_cursor_get(const xbt_dynar_t dynar, unsigned int idx, void *const dst)
+static inline int _xbt_dynar_cursor_get(const xbt_dynar_t dynar, unsigned int idx, void *const dst)
 {
   if (!dynar) /* iterating over a NULL dynar is a no-op */
     return FALSE;
@@ -256,6 +256,17 @@ xbt_dynar_foreach (dyn,cpt,str) {
             (_cursor)++         )
 #endif
 /** @} */
-
 SG_END_DECL()
+
+#ifdef __cplusplus
+namespace simgrid {
+namespace xbt {
+  inline void destroy(xbt_dynar_t s)
+  {
+    xbt_dynar_free(&s);
+  }
+}
+}
+#endif
+
 #endif                          /* _XBT_DYNAR_H */