[glib-networking/wip/openssl: 10/22] tls/openssl/openssl-util.c: Fix Build On MSVC



commit c6ac70185dff877e21441b73e021c599b03f9d5c
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Sep 3 14:38:23 2015 +0800

    tls/openssl/openssl-util.c: Fix Build On MSVC
    
    Visual Studio does not have strncasecmp(), but instead uses _strnicmp(),
    which is identical.  Note that the GLib functions are not used here
    because this file does not in any way include the GLib headers.

 tls/openssl/openssl-util.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/tls/openssl/openssl-util.c b/tls/openssl/openssl-util.c
index 9c0a2f5..5ba63f1 100644
--- a/tls/openssl/openssl-util.c
+++ b/tls/openssl/openssl-util.c
@@ -67,6 +67,10 @@
 #include <string.h>
 #include <openssl/x509v3.h>
 
+#ifdef _MSC_VER
+#define strncasecmp _strnicmp
+#endif
+
 typedef int (*equal_fn) (const unsigned char *pattern, size_t pattern_len,
                          const unsigned char *subject, size_t subject_len,
                          unsigned int flags);


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