From: Christophe ThiƩry Date: Fri, 22 Apr 2011 15:19:13 +0000 (+0200) Subject: Define the right type for xbt_os_thread_key_t X-Git-Tag: v3_6_rc3~103 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f0d406118f42093c818f66253e4b8aaa60a7f002 Define the right type for xbt_os_thread_key_t --- diff --git a/src/include/xbt/xbt_os_thread.h b/src/include/xbt/xbt_os_thread.h index 22d56bb172..870af9bf9c 100644 --- a/src/include/xbt/xbt_os_thread.h +++ b/src/include/xbt/xbt_os_thread.h @@ -10,6 +10,7 @@ #ifndef _XBT_OS_THREAD_H #define _XBT_OS_THREAD_H +#include "gras_config.h" #include "xbt/misc.h" /* SG_BEGIN_DECL */ #include "xbt/function_types.h" @@ -26,7 +27,12 @@ SG_BEGIN_DECL() /** \brief Thread data type (opaque structure) */ typedef struct xbt_os_thread_ *xbt_os_thread_t; -typedef unsigned int xbt_os_thread_key_t; +#ifdef HAVE_PTHREAD_H +#include +typedef pthread_key_t xbt_os_thread_key_t; +#elif defined(_XBT_WIN32) +typedef DWORD xbt_os_thread_key_t; +#endif /* Calls pthread_atfork() if present, and else does nothing. * The only known user of this wrapper is mmalloc_preinit(). diff --git a/src/xbt/xbt_os_thread.c b/src/xbt/xbt_os_thread.c index 7d58f3e40f..e8c86e3c0e 100644 --- a/src/xbt/xbt_os_thread.c +++ b/src/xbt/xbt_os_thread.c @@ -23,7 +23,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_sync_os, xbt, /* ********************************* PTHREAD IMPLEMENTATION ************************************ */ #ifdef HAVE_PTHREAD_H -#include #include #ifdef HAVE_MUTEX_TIMEDLOCK