Skip to content

Commit 3f27c54

Browse files
authored
build fix for MSVC compilation. (#17)
I tried to use rtlog-cpp on Windows sing VC++, but it does not like GCC extension attributes. If I understand correctly, `format` does not affect run-time behavior, so I simply took it out for VC++.
1 parent 1706255 commit 3f27c54

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

include/rtlog/rtlog.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ class Logger {
131131
* `Status::Error_MessageTruncated`. Otherwise, it returns `Status::Success`.
132132
*/
133133
Status Log(LogData &&inputData, const char *format, ...)
134-
__attribute__((format(printf, 3, 4))) {
134+
#ifndef __MSC_VER__
135+
__attribute__((format(printf, 3, 4)))
136+
#endif
137+
{
135138
va_list args;
136139
va_start(args, format);
137140
auto retVal = Logv(std::move(inputData), format, args);

0 commit comments

Comments
 (0)