From: Arnaud Giersch Date: Thu, 5 Apr 2018 07:20:34 +0000 (+0200) Subject: Don't depend on . X-Git-Tag: v3.20~517 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8ffb62089250c85576933a6eb1bb3be501712840?ds=sidebyside Don't depend on . It's inclusion in xbt/base.h breaks existing MPI codesi (e.g. AMG2013). --- diff --git a/include/xbt/base.h b/include/xbt/base.h index 7cb057e917..ab3afcd290 100644 --- a/include/xbt/base.h +++ b/include/xbt/base.h @@ -186,10 +186,6 @@ #endif -#ifndef __cplusplus -#include -#endif - /* C++ users need love */ #ifndef SG_BEGIN_DECL # ifdef __cplusplus diff --git a/include/xbt/dynar.h b/include/xbt/dynar.h index fee93eb359..52a99e05b9 100644 --- a/include/xbt/dynar.h +++ b/include/xbt/dynar.h @@ -208,17 +208,17 @@ typedef struct xbt_dynar_s { 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; + return 0; if (idx >= dynar->used) { //XBT_DEBUG("Cursor on %p already on last elem", (void *) dynar); - return false; + return 0; } // XBT_DEBUG("Cash out cursor on %p at %u", (void *) dynar, *idx); memcpy(dst, ((char *) dynar->data) + idx * dynar->elmsize, dynar->elmsize); - return true; + return 1; } /** @brief Iterates over the whole dynar. diff --git a/src/xbt/dict_cursor.c b/src/xbt/dict_cursor.c index 9959a34c03..f6b6a3d045 100644 --- a/src/xbt/dict_cursor.c +++ b/src/xbt/dict_cursor.c @@ -128,17 +128,17 @@ inline int xbt_dict_cursor_get_or_free(xbt_dict_cursor_t * cursor, char **key, v XBT_CDEBUG(xbt_dict_cursor, "xbt_dict_get_or_free"); if (!cursor || !(*cursor)) - return false; + return 0; current = (*cursor)->current; if (current == NULL) { /* no data left */ xbt_dict_cursor_free(cursor); - return false; + return 0; } *key = current->key; *data = current->content; - return true; + return 1; } /**