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
Merge branch 'master' into S4U
[simgrid.git]
/
include
/
xbt
/
swag.h
diff --git
a/include/xbt/swag.h
b/include/xbt/swag.h
index
2e3bed9
..
8800b4b
100644
(file)
--- a/
include/xbt/swag.h
+++ b/
include/xbt/swag.h
@@
-1,4
+1,4
@@
-/* Copyright (c) 2004-201
2
. The SimGrid Team.
+/* Copyright (c) 2004-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
@@
-149,11
+149,17
@@
static XBT_INLINE void *xbt_swag_getFirst(xbt_swag_t swag)
* @param swag what to iterate over
* @warning you cannot modify the \a swag while using this loop
* @hideinitializer */
* @param swag what to iterate over
* @warning you cannot modify the \a swag while using this loop
* @hideinitializer */
+#ifndef __cplusplus
#define xbt_swag_foreach(obj,swag) \
for((obj)=xbt_swag_getFirst((swag)); \
(obj)!=NULL; \
(obj)=xbt_swag_getNext((obj),(swag)->offset))
#define xbt_swag_foreach(obj,swag) \
for((obj)=xbt_swag_getFirst((swag)); \
(obj)!=NULL; \
(obj)=xbt_swag_getNext((obj),(swag)->offset))
-
+#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
/**
* @brief A safe swag iterator
* @param obj the indice of the loop