Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ilog.h: Added VA_OPT to avoid preprocessor error for VA_ARGS #100

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/ILog.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ extern ILog const * _log;
#undef module_name
#define module_name 0

#define Message(s, ...) _Message(0, module_name, s , ##__VA_ARGS__)
#define Warning(s, ...) _Message(1, module_name, s , ##__VA_ARGS__)
#define Error(s, ...) _Message(2, module_name, s , ##__VA_ARGS__)
#define Green(s, ...) _Message(3, module_name, s , ##__VA_ARGS__)
#define Progress(s, ...) _Message(99, "Progress", s , ##__VA_ARGS__)
#define Message(s, ...) _Message(0, module_name, s __VA_OPT__(,) __VA_ARGS__)
#define Warning(s, ...) _Message(1, module_name, s __VA_OPT__(,) __VA_ARGS__)
#define Error(s, ...) _Message(2, module_name, s __VA_OPT__(,) __VA_ARGS__)
#define Green(s, ...) _Message(3, module_name, s __VA_OPT__(,) __VA_ARGS__)
#define Progress(s, ...) _Message(99, "Progress", s __VA_OPT__(,) __VA_ARGS__)

//#define VERBOSE

#ifdef VERBOSE
#define Verbose(s, ...) _Message(0, module_name, s, ##__VA_ARGS__)
#define Verbose(s, ...) _Message(0, module_name, s __VA_OPT__(,) __VA_ARGS__)
#else
#define Verbose(s, ...) null
#endif

#ifdef DEBUGLOG
#define Debug(lvl, s, ...) _Debug(lvl, module_name, s, ##__VA_ARGS__)
#define Debug(lvl, s, ...) _Debug(lvl, module_name, s __VA_OPT__(,) __VA_ARGS__)
#else
#define Debug(lvl, s, ...) null
#endif
Expand Down