mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
add mi_decl_maybe_unused; fix compilation with OPT_SIMD (issue #1009)
This commit is contained in:
parent
fe5258a179
commit
d8c119cc4f
4 changed files with 41 additions and 21 deletions
|
@ -18,11 +18,7 @@ terms of the MIT license. A copy of the license can be found in the file
|
|||
#include "track.h"
|
||||
#include "bits.h"
|
||||
|
||||
#if (MI_DEBUG>0)
|
||||
#define mi_trace_message(...) _mi_trace_message(__VA_ARGS__)
|
||||
#else
|
||||
#define mi_trace_message(...)
|
||||
#endif
|
||||
#define mi_decl_cache_align mi_decl_align(64)
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(disable:4127) // suppress constant conditional warning (due to MI_SECURE paths)
|
||||
|
@ -52,19 +48,32 @@ terms of the MIT license. A copy of the license can be found in the file
|
|||
#define mi_decl_hidden
|
||||
#endif
|
||||
|
||||
#define mi_decl_cache_align mi_decl_align(64)
|
||||
#if (defined(__GNUC__) && (__GNUC__ >= 7)) || defined(__clang__) // includes clang and icc
|
||||
#define mi_decl_maybe_unused __attribute__((unused))
|
||||
#elif __cplusplus >= 201703L // c++17
|
||||
#define mi_decl_maybe_unused [[maybe_unused]]
|
||||
#else
|
||||
#define mi_decl_maybe_unused
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#define mi_decl_externc extern "C"
|
||||
#else
|
||||
#define mi_decl_externc
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__EMSCRIPTEN__) && !defined(__wasi__)
|
||||
#define __wasi__
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#define mi_decl_externc extern "C"
|
||||
#if (MI_DEBUG>0)
|
||||
#define mi_trace_message(...) _mi_trace_message(__VA_ARGS__)
|
||||
#else
|
||||
#define mi_decl_externc
|
||||
#define mi_trace_message(...)
|
||||
#endif
|
||||
|
||||
|
||||
// "libc.c"
|
||||
#include <stdarg.h>
|
||||
int _mi_vsnprintf(char* buf, size_t bufsize, const char* fmt, va_list args);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue