mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-25 19:04:35 +00:00
log : fix MSVC compile errors (#5643)
MSVC gives the following error with the existing macros: `Error C2059 : syntax error: ','` This patch adds `##` as a prefix to `__VA_ARGS__` to address this error.
This commit is contained in:
parent
6cdabe6526
commit
581ed5c4fe
@ -297,7 +297,7 @@ inline std::string log_filename_generator_impl(LogTriState multilog, const std::
|
|||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
#define LOG(...) LOG_IMPL(__VA_ARGS__, "")
|
#define LOG(...) LOG_IMPL(__VA_ARGS__, "")
|
||||||
#else
|
#else
|
||||||
#define LOG(str, ...) LOG_IMPL("%s" str, "", __VA_ARGS__, "")
|
#define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Main TEE macro.
|
// Main TEE macro.
|
||||||
@ -311,7 +311,7 @@ inline std::string log_filename_generator_impl(LogTriState multilog, const std::
|
|||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
#define LOG_TEE(...) LOG_TEE_IMPL(__VA_ARGS__, "")
|
#define LOG_TEE(...) LOG_TEE_IMPL(__VA_ARGS__, "")
|
||||||
#else
|
#else
|
||||||
#define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", __VA_ARGS__, "")
|
#define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// LOG macro variants with auto endline.
|
// LOG macro variants with auto endline.
|
||||||
@ -319,8 +319,8 @@ inline std::string log_filename_generator_impl(LogTriState multilog, const std::
|
|||||||
#define LOGLN(...) LOG_IMPL(__VA_ARGS__, "\n")
|
#define LOGLN(...) LOG_IMPL(__VA_ARGS__, "\n")
|
||||||
#define LOG_TEELN(...) LOG_TEE_IMPL(__VA_ARGS__, "\n")
|
#define LOG_TEELN(...) LOG_TEE_IMPL(__VA_ARGS__, "\n")
|
||||||
#else
|
#else
|
||||||
#define LOGLN(str, ...) LOG_IMPL("%s" str, "", __VA_ARGS__, "\n")
|
#define LOGLN(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "\n")
|
||||||
#define LOG_TEELN(str, ...) LOG_TEE_IMPL("%s" str, "", __VA_ARGS__, "\n")
|
#define LOG_TEELN(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "\n")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// INTERNAL, DO NOT USE
|
// INTERNAL, DO NOT USE
|
||||||
|
Loading…
Reference in New Issue
Block a user