diff options
Diffstat (limited to 'source/dng_pthread.h')
-rw-r--r-- | source/dng_pthread.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/dng_pthread.h b/source/dng_pthread.h index 0a28a1b..2095321 100644 --- a/source/dng_pthread.h +++ b/source/dng_pthread.h @@ -53,6 +53,14 @@ #endif +// Use the standard "timespec" struct for VS2015 and above from <time.h>. Define +// "dng_timespec" as "timespec" otherwise. +#if _MSC_VER >= 1900 +#include <time.h> +#else +#define timespec dng_timespec +#endif + #ifdef __cplusplus extern "C" { @@ -67,7 +75,6 @@ struct dng_timespec { long tv_nsec; }; - typedef unsigned long dng_pthread_t; typedef struct dng_pthread_mutex_impl *dng_pthread_mutex_t; @@ -179,8 +186,6 @@ void dng_pthread_terminate(); #undef PTHREAD_ONCE_INIT #define PTHREAD_ONCE_INIT DNG_PTHREAD_ONCE_INIT -#define timespec dng_timespec - /* If it is defined on Windows, it probably has the wrong value... */ #if defined(WIN32) || !defined(ETIMEDOUT) #undef ETIMEDOUT |