diff --git a/lib/include/bofstd/bofconio.h b/lib/include/bofstd/bofconio.h index b5a50e4..ec87f89 100644 --- a/lib/include/bofstd/bofconio.h +++ b/lib/include/bofstd/bofconio.h @@ -24,8 +24,8 @@ #include BEGIN_BOF_NAMESPACE() -#define PrintfAt(x, y, pFormat, ...) PrintfAtColor(mForeColor_E, x, y, pFormat, __VA_ARGS__) -#define PrintfColor(Color, pFormat, ...) PrintfAtColor(Color, 0, 0, pFormat, __VA_ARGS__) +#define PrintfAt(x, y, pFormat, ...) PrintfAtColor(mForeColor_E, x, y, pFormat, ##__VA_ARGS__) +#define PrintfColor(Color, pFormat, ...) PrintfAtColor(Color, 0, 0, pFormat, ##__VA_ARGS__) enum CONIO_MODIFIER_KEY_FLAG : uint32_t { diff --git a/lib/include/bofstd/boflogger.h b/lib/include/bofstd/boflogger.h index c322ec5..e9c562b 100644 --- a/lib/include/bofstd/boflogger.h +++ b/lib/include/bofstd/boflogger.h @@ -34,9 +34,9 @@ const uint32_t BOF_LOGGER_CHANNEL_FLAG_MASK_DBG_ALWAYS = 0x80000000; /*! Always const uint32_t BOF_LOGGER_CHANNEL_FLAG_MASK_DBG_ERROR = 0x40000000; /*! Display error */ const uint32_t BOF_LOGGER_MAX_FAST_FORMAT_BUFFER_SIZE = 0x8000; #if defined(_WIN32) -#define BOF_LOG_TO_DBG(pFormat,...) {std::string Dbg;BOF::Bof_Sprintf(pFormat, __VA_ARGS__);OutputDebugString(Dbg.c_str());} +#define BOF_LOG_TO_DBG(pFormat,...) {std::string Dbg;BOF::Bof_Sprintf(pFormat, ##__VA_ARGS__);OutputDebugString(Dbg.c_str());} #else -#define BOF_LOG_TO_DBG(pFormat,...) {printf(pFormat, __VA_ARGS__);} +#define BOF_LOG_TO_DBG(pFormat,...) {printf(pFormat, ##__VA_ARGS__);} #endif // #define BOF_LOGGER_DEBUG_ON // To avoid extra cost when we want no log and no fct call at all // The ##__VA_ARGS__ syntax is non-standard. It is a "swallow comma if the __VA_ARGS__ is empty" extension implemented by GCC, and seems to have been adopted by other compilers. diff --git a/lib/src/bofsocketthread.cpp b/lib/src/bofsocketthread.cpp index 79e633a..b4d8ee6 100644 --- a/lib/src/bofsocketthread.cpp +++ b/lib/src/bofsocketthread.cpp @@ -18,7 +18,7 @@ BEGIN_BOF_NAMESPACE() constexpr uint32_t PUSH_POP_TIMEOUT = 150; // Global To for getting command out of incoming queue, in ListeningMode_B it is half of the To specified for listen constexpr uint32_t DEF_IO_TIMEOUT = 2000; -#define SOCK_IO_DBG(pFormat,...) {printf("%d: " pFormat,Bof_GetMsTickCount(), __VA_ARGS__);} +#define SOCK_IO_DBG(pFormat,...) {printf("%d: " pFormat,Bof_GetMsTickCount(), ##__VA_ARGS__);} #define SOCK_THREAD_PROGRAM_OPERATION(Field, Operation) \ BOFERR Rts_E; \ BOF_SOCKET_OPERATION_PARAM Param_X; \ diff --git a/tests/src/ut_logger.cpp b/tests/src/ut_logger.cpp index 605d8ed..4a4d11a 100644 --- a/tests/src/ut_logger.cpp +++ b/tests/src/ut_logger.cpp @@ -332,12 +332,12 @@ void MyExternalSingleChannelLibCode(std::shared_ptr _psL EXPECT_EQ(NbLogRejected_U32, 1); } /* -#define WLOG(channel, ...) BOF_LOG_WARNING(MY_LOGGER, channel, __VA_ARGS__); +#define WLOG(channel, ...) BOF_LOG_WARNING(MY_LOGGER, channel, ##__VA_ARGS__); #define MY_LOGGER TheBhaLogger BOF_LOGGER_DEFINE_STORAGE(MY_LOGGER, LOGGER_CHANNEL_MAX); */ constexpr uint32_t MAX_MULTI_CHANNEL = 3; -#define WLOG(channel, ...) BOF_LOG_WARNING(MY_UT_LOGGER, channel, __VA_ARGS__); +#define WLOG(channel, ...) BOF_LOG_WARNING(MY_UT_LOGGER, channel, ##__VA_ARGS__); #define MY_UT_LOGGER TheUtLogger BOF_LOGGER_DEFINE_STORAGE(MyExternalMultipleChannelLibLogger, MAX_MULTI_CHANNEL); void MyExternalMultipleChannelLibInit(std::shared_ptr _psLoggerFactory)