Add OPENSSL_str[n]casecmp
Windows has different names for these functions and also doesn't have
the strings.h header in which they appear.
This change adds tiny wrapper functions for Windows.
diff --git a/crypto/mem.c b/crypto/mem.c
index c2fd5fc..9cf0aa0 100644
--- a/crypto/mem.c
+++ b/crypto/mem.c
@@ -135,6 +135,28 @@
return len;
}
+#if defined(OPENSSL_WINDOWS)
+
+int OPENSSL_strcasecmp(const char *a, const char *b) {
+ return _stricmp(a, b, n);
+}
+
+int OPENSSL_strncasecmp(const char *a, const char *b, size_t n) {
+ return _strnicmp(a, b, n);
+}
+
+#else
+
+int OPENSSL_strcasecmp(const char *a, const char *b) {
+ return strcasecmp(a, b);
+}
+
+int OPENSSL_strncasecmp(const char *a, const char *b, size_t n) {
+ return strncasecmp(a, b, n);
+}
+
+#endif
+
int BIO_snprintf(char *buf, size_t n, const char *format, ...) {
va_list args;
int ret;