diff options
author | Adam Langley <agl@chromium.org> | 2014-06-20 23:00:00 +0400 |
---|---|---|
committer | Adam Langley <agl@chromium.org> | 2014-06-21 00:17:43 +0400 |
commit | b0d5fb6c742130fd2075298eaa853c6e0b2036ad (patch) | |
tree | f94dfb27b9fce4b6dc94f21f3384b70cc57c21c6 /crypto/mem.c | |
parent | 94d86b1f67e005f3085c6cc9f987c2176e1ed1fc (diff) |
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.
Diffstat (limited to 'crypto/mem.c')
-rw-r--r-- | crypto/mem.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/crypto/mem.c b/crypto/mem.c index c2fd5fc7..9cf0aa00 100644 --- a/crypto/mem.c +++ b/crypto/mem.c @@ -135,6 +135,28 @@ size_t OPENSSL_strnlen(const char *s, size_t len) { 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; |