mirror of
https://github.com/microsoft/mimalloc.git
synced 2024-12-28 05:50:51 +08:00
fix -Wunused-function for mi_strn-cmp; originally by @rui314 in PR #662 but rebased to dev branch
This commit is contained in:
parent
8c89a77064
commit
2b0421a25c
@ -494,13 +494,6 @@ static bool mi_getenv(const char* name, char* result, size_t result_size) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline int mi_strnicmp(const char* s, const char* t, size_t n) {
|
|
||||||
if (n==0) return 0;
|
|
||||||
for (; *s != 0 && *t != 0 && n > 0; s++, t++, n--) {
|
|
||||||
if (toupper(*s) != toupper(*t)) break;
|
|
||||||
}
|
|
||||||
return (n==0 ? 0 : *s - *t);
|
|
||||||
}
|
|
||||||
#if defined _WIN32
|
#if defined _WIN32
|
||||||
// On Windows use GetEnvironmentVariable instead of getenv to work
|
// On Windows use GetEnvironmentVariable instead of getenv to work
|
||||||
// reliably even when this is invoked before the C runtime is initialized.
|
// reliably even when this is invoked before the C runtime is initialized.
|
||||||
@ -526,6 +519,13 @@ static char** mi_get_environ(void) {
|
|||||||
return environ;
|
return environ;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
static int mi_strnicmp(const char* s, const char* t, size_t n) {
|
||||||
|
if (n == 0) return 0;
|
||||||
|
for (; *s != 0 && *t != 0 && n > 0; s++, t++, n--) {
|
||||||
|
if (toupper(*s) != toupper(*t)) break;
|
||||||
|
}
|
||||||
|
return (n == 0 ? 0 : *s - *t);
|
||||||
|
}
|
||||||
static bool mi_getenv(const char* name, char* result, size_t result_size) {
|
static bool mi_getenv(const char* name, char* result, size_t result_size) {
|
||||||
if (name==NULL) return false;
|
if (name==NULL) return false;
|
||||||
const size_t len = strlen(name);
|
const size_t len = strlen(name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user