Commit 3691c172 authored by Parnic's avatar Parnic Committed by Adam Cozzette

Replaced unavailable include with struct definition for Xbox One

It appears this file was including winsock2.h just to get the timeval struct definition. There are platforms, such as Xbox One, that don't use winsock but do compile with _MSC_VER set, so just drop in the struct definition we needed instead of including all of winsock. This fixes compilation of this file for Xbox One. Without this change, there were numerous `timeval` complaints such as
```
1>c:\dev\protobuf\src\google\protobuf\util\time_util.h(153): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (compiling source file C:\dev\protobuf\src\google\protobuf\util\time_util.cc)
1>c:\dev\protobuf\src\google\protobuf\util\time_util.h(153): error C2143: syntax error: missing ',' before '&' (compiling source file C:\dev\protobuf\src\google\protobuf\util\time_util.cc)
```
etc.
parent 2bb7c278
...@@ -37,7 +37,14 @@ ...@@ -37,7 +37,14 @@
#include <ostream> #include <ostream>
#include <string> #include <string>
#ifdef _MSC_VER #ifdef _MSC_VER
#ifdef _XBOX_ONE
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
};
#else
#include <winsock2.h> #include <winsock2.h>
#endif // _XBOX_ONE
#else #else
#include <sys/time.h> #include <sys/time.h>
#endif #endif
......
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