A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[mc] Cleanup #includes
[simgrid.git]
/
include
/
xbt
/
dynar.h
diff --git
a/include/xbt/dynar.h
b/include/xbt/dynar.h
index 31b5adbaf74eb698598138005e0efd90612b9a8b..007926ec661aac252541408b9aeb3c8f5f6d98f2 100644
(file)
--- a/
include/xbt/dynar.h
+++ b/
include/xbt/dynar.h
@@
-1,6
+1,6
@@
/* dynar - a generic dynamic array */
/* dynar - a generic dynamic array */
-/* Copyright (c) 2004-2007, 2009-201
4
. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-201
5
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-11,7
+11,7
@@
#include <string.h> /* memcpy */
#include <string.h> /* memcpy */
-#include "xbt/
misc
.h" /* SG_BEGIN_DECL */
+#include "xbt/
base
.h" /* SG_BEGIN_DECL */
#include "xbt/function_types.h"
SG_BEGIN_DECL()
#include "xbt/function_types.h"
SG_BEGIN_DECL()
@@
-228,7
+228,7
@@
typedef struct xbt_dynar_s {
} s_xbt_dynar_t;
static XBT_INLINE void
} s_xbt_dynar_t;
static XBT_INLINE void
-_xbt_dynar_cursor_first(const xbt_dynar_t dynar
_XBT_GNUC
_UNUSED,
+_xbt_dynar_cursor_first(const xbt_dynar_t dynar
XBT_ATTRIB
_UNUSED,
unsigned int *const cursor)
{
/* iterating over a NULL dynar is a no-op (but we don't want to have uninitialized counters) */
unsigned int *const cursor)
{
/* iterating over a NULL dynar is a no-op (but we don't want to have uninitialized counters) */
@@
-284,11
+284,17
@@
xbt_dynar_foreach (dyn,cpt,str) {
_xbt_dynar_cursor_get(_dynar,_cursor,&_data) ; \
(_cursor)++ )
_xbt_dynar_cursor_get(_dynar,_cursor,&_data) ; \
(_cursor)++ )
+#ifndef __cplusplus
#define xbt_dynar_foreach_ptr(_dynar,_cursor,_ptr) \
for (_xbt_dynar_cursor_first(_dynar,&(_cursor)) ; \
(_ptr = _cursor < _dynar->used ? xbt_dynar_get_ptr(_dynar,_cursor) : NULL) ; \
(_cursor)++ )
#define xbt_dynar_foreach_ptr(_dynar,_cursor,_ptr) \
for (_xbt_dynar_cursor_first(_dynar,&(_cursor)) ; \
(_ptr = _cursor < _dynar->used ? xbt_dynar_get_ptr(_dynar,_cursor) : NULL) ; \
(_cursor)++ )
-
+#else
+#define xbt_dynar_foreach_ptr(_dynar,_cursor,_ptr) \
+ for (_xbt_dynar_cursor_first(_dynar,&(_cursor)) ; \
+ (_ptr = _cursor < _dynar->used ? (decltype(_ptr)) xbt_dynar_get_ptr(_dynar,_cursor) : NULL) ; \
+ (_cursor)++ )
+#endif
/** @} */
SG_END_DECL()
/** @} */
SG_END_DECL()