Commit ecfafdcb authored by Jose Fonseca's avatar Jose Fonseca

c11/threads: Include thr/xtimec.h for xtime definition when building with MSVC.

MSVC has been including a xtime definition in thr/xtimec.h ever since
MSVC 2013 (which is the minimum we require for building Mesa), and
including it prevents duplicate definitions when it gets included by

In fact, it looks that MSVC has been including a partial C11 threads
implementation too for some time, which we should consider migrating to
once we eliminate the use of _MTX_INITIALIZER_NP in our tree.

Thanks to the anonymous helper from for spotting
Reviewed-by: default avatarRoland Scheidegger <>
CC: "17.0" <>
parent e44cba54
......@@ -30,6 +30,9 @@
#include <time.h>
#ifdef _MSC_VER
#include <thr/xtimec.h> // for xtime
#ifndef TIME_UTC
#define TIME_UTC 1
......@@ -41,11 +44,13 @@
typedef void (*tss_dtor_t)(void*);
typedef int (*thrd_start_t)(void*);
#ifndef _MSC_VER
struct xtime {
time_t sec;
long nsec;
typedef struct xtime xtime;
/*-------------------- enumeration constants --------------------*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment