Imported Upstream version 2.72.alpha
[platform/upstream/glib-networking.git] / tls / openssl / openssl-include.h
index 7a6a460..6dc6516 100644 (file)
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * gtlscertificate-openssl.h
  *
  *          Christoph Reiter
  */
 
+#pragma once
+
 /* Due to name clashes between Windows and openssl headers we have to
  * make sure windows.h is included before openssl and that we undef the
- * clashing macros.
+ * clashing macros. We also need `struct timeval` for DTLSv1_get_timeout(),
+ * and the following header also covers it for Windows.
  */
-
-#ifndef __G_TLS_OPENSSL_INCLUDE_H__
-#define __G_TLS_OPENSSL_INCLUDE_H__
-
-#include "glib.h"
-
+#include <gio/gnetworking.h>
 #ifdef G_OS_WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
 /* These are defined by the Windows headers, but clash with openssl */
 #undef X509_NAME
 #undef X509_CERT_PAIR
 #undef X509_EXTENSIONS
 #undef OCSP_REQUEST
 #undef OCSP_RESPONSE
+#else
+/* Need `struct timeval` for DTLSv1_get_timeout() */
+#include <sys/time.h>
 #endif
 
 #include <openssl/ssl.h>
@@ -51,8 +51,4 @@
 #include <openssl/x509_vfy.h>
 #include <openssl/x509v3.h>
 #include <openssl/crypto.h>
-#if (OPENSSL_VERSION_NUMBER >= 0x0090808fL) && !defined(OPENSSL_NO_OCSP)
 #include <openssl/ocsp.h>
-#endif
-
-#endif /* __G_TLS_OPENSSL_INCLUDE_H__ */