[glib-networking/wip/pwithnall/dtls: 13/18] gnutls: Define EMSGSIZE on Windows systems



commit 5801756732f66ee69a5ade38636deeb2bea6bfe7
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Apr 3 13:08:20 2014 +0100

    gnutls: Define EMSGSIZE on Windows systems
    
    It isn’t clear whether all versions of MinGW define EMSGSIZE, so define
    it to WSAEMSGSIZE as a fallback if it isn’t defined.
    
    See:
    http://msdn.microsoft.com/en-us/library/windows/desktop/ms740668%28v=vs.85%29.aspx#wsaemsgsize
    
    Based on a patch originally by Luciana Fujii
    <luciana fujii collabora com>.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697908

 tls/gnutls/gtlsconnection-gnutls.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index e88d733..f57dd2f 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -41,6 +41,16 @@
 #include "pkcs11/gpkcs11pin.h"
 #endif
 
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <winerror.h>
+
+/* It isn’t clear whether MinGW always defines EMSGSIZE. */
+#ifndef EMSGSIZE
+#define EMSGSIZE WSAEMSGSIZE
+#endif
+#endif
+
 #include <glib/gi18n-lib.h>
 
 static ssize_t g_tls_connection_gnutls_push_func (gnutls_transport_ptr_t  transport_data,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]