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



commit 336c3c8b63d507ee4cd16b4bd195e96775c105c4
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]