Remove OPENSSL_timeval.
With DTLSv1_get_timeout de-ctrl-ified, the type checker complains about
OPENSSL_timeval. Existing callers all use the real timeval.
Now that OPENSSL_timeval is not included in any public structs, simply
forward-declare timeval itself in ssl.h and pull in winsock2.h in internal
headers.
Change-Id: Ieaf110e141578488048c28cdadb14881301a2ce1
Reviewed-on: https://boringssl-review.googlesource.com/4682
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/internal.h b/ssl/internal.h
index ee76a73..1d8b2bf 100644
--- a/ssl/internal.h
+++ b/ssl/internal.h
@@ -149,6 +149,15 @@
#include <openssl/ssl.h>
#include <openssl/stack.h>
+#if defined(OPENSSL_WINDOWS)
+/* Windows defines struct timeval in winsock2.h. */
+#pragma warning(push, 3)
+#include <winsock2.h>
+#pragma warning(pop)
+#else
+#include <sys/types.h>
+#endif
+
/* Cipher suites. */
@@ -739,9 +748,8 @@
unsigned int num_timeouts;
/* Indicates when the last handshake msg or heartbeat sent will
- * timeout. Because of header issues on Windows, this cannot actually be a
- * struct timeval. */
- OPENSSL_timeval next_timeout;
+ * timeout. */
+ struct timeval next_timeout;
/* Timeout duration */
unsigned short timeout_duration;