Commit 38e2756f authored by brucedawson's avatar brucedawson Committed by Commit bot

Don't define timespec in VS 2015 builds.

VS 2015 includes time.h from stdlib.h which leads to redefinition
warnings when threads_windows.h defines the timespec struct.

Ideally threads_windows.h shouldn't be defining CRT structs at all, but
I am doing the minimum scoped change to move VS 2015 development
forwards.

_MSC_VER == 1900 represents the VC++ 2015 compiler.

R=reillyg@chromium.org
BUG=440500

Review URL: https://codereview.chromium.org/1067093002

Cr-Commit-Position: refs/heads/master@{#324133}
parent de446058
...@@ -44,10 +44,13 @@ typedef struct usbi_cond_t_ usbi_cond_t; ...@@ -44,10 +44,13 @@ typedef struct usbi_cond_t_ usbi_cond_t;
#if (!defined(HAVE_STRUCT_TIMESPEC) && !defined(_TIMESPEC_DEFINED)) #if (!defined(HAVE_STRUCT_TIMESPEC) && !defined(_TIMESPEC_DEFINED))
#define HAVE_STRUCT_TIMESPEC 1 #define HAVE_STRUCT_TIMESPEC 1
#define _TIMESPEC_DEFINED 1 #define _TIMESPEC_DEFINED 1
#if _MSC_VER < 1900
// VS 2015 and above include <time.h> in stdlib.h
struct timespec { struct timespec {
long tv_sec; long tv_sec;
long tv_nsec; long tv_nsec;
}; };
#endif
#endif /* HAVE_STRUCT_TIMESPEC | _TIMESPEC_DEFINED */ #endif /* HAVE_STRUCT_TIMESPEC | _TIMESPEC_DEFINED */
// We *were* getting ETIMEDOUT from pthread.h: // We *were* getting ETIMEDOUT from pthread.h:
......
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