Merge branch 'dev' into dev-slice

This commit is contained in:
Daan 2021-10-19 10:17:53 -07:00
commit a4078df9d5
10 changed files with 43 additions and 23 deletions

View file

@ -22,7 +22,7 @@ terms of the MIT license. A copy of the license can be found in the file
static uintptr_t mi_max_error_count = 16; // stop outputting errors after this
static uintptr_t mi_max_warning_count = 16; // stop outputting warnings after this
static void mi_add_stderr_output();
static void mi_add_stderr_output(void);
int mi_version(void) mi_attr_noexcept {
return MI_MALLOC_VERSION;
@ -412,6 +412,14 @@ static void mi_strlcat(char* dest, const char* src, size_t dest_size) {
dest[dest_size - 1] = 0;
}
#ifdef MI_NO_GETENV
static bool mi_getenv(const char* name, char* result, size_t result_size) {
UNUSED(name);
UNUSED(result);
UNUSED(result_size);
return false;
}
#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--) {
@ -419,7 +427,6 @@ static inline int mi_strnicmp(const char* s, const char* t, size_t n) {
}
return (n==0 ? 0 : *s - *t);
}
#if defined _WIN32
// On Windows use GetEnvironmentVariable instead of getenv to work
// reliably even when this is invoked before the C runtime is initialized.
@ -487,7 +494,8 @@ static bool mi_getenv(const char* name, char* result, size_t result_size) {
return false;
}
}
#endif
#endif // !MI_USE_ENVIRON
#endif // !MI_NO_GETENV
static void mi_option_init(mi_option_desc_t* desc) {
// Read option value from the environment