Skip to content

Fixes macro issue wrt. dangling else #25

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

Open
wants to merge 2 commits into
base: main
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
43 changes: 24 additions & 19 deletions report/include/scp/report.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,29 +497,34 @@ class call_sc_name_fn
/*** End HELPER Macros *******/

//! macro for debug trace level output
#define SCP_TRACEALL(...) \
if (SCP_VBSTY_CHECK(sc_core::SC_DEBUG, ##__VA_ARGS__)) \
SCP_LOG(sc_core::SC_DEBUG, __VA_ARGS__)
#define SCP_TRACEALL(...) \
if (!(SCP_VBSTY_CHECK(sc_core::SC_DEBUG, ##__VA_ARGS__))) { \
} else \
SCP_LOG(sc_core::SC_DEBUG, __VA_ARGS__)
//! macro for trace level output
#define SCP_TRACE(...) \
if (SCP_VBSTY_CHECK(sc_core::SC_FULL, ##__VA_ARGS__)) \
SCP_LOG(sc_core::SC_FULL, __VA_ARGS__)
#define SCP_TRACE(...) \
if (!(SCP_VBSTY_CHECK(sc_core::SC_FULL, ##__VA_ARGS__))) { \
} else \
SCP_LOG(sc_core::SC_FULL, __VA_ARGS__)
//! macro for debug level output
#define SCP_DEBUG(...) \
if (SCP_VBSTY_CHECK(sc_core::SC_HIGH, ##__VA_ARGS__)) \
SCP_LOG(sc_core::SC_HIGH, __VA_ARGS__)
#define SCP_DEBUG(...) \
if (!(SCP_VBSTY_CHECK(sc_core::SC_HIGH, ##__VA_ARGS__))) { \
} else \
SCP_LOG(sc_core::SC_HIGH, __VA_ARGS__)
//! macro for info level output
#define SCP_INFO(...) \
if (SCP_VBSTY_CHECK(sc_core::SC_MEDIUM, ##__VA_ARGS__)) \
SCP_LOG(sc_core::SC_MEDIUM, __VA_ARGS__)
#define SCP_INFO(...) \
if (!(SCP_VBSTY_CHECK(sc_core::SC_MEDIUM, ##__VA_ARGS__))) { \
} else \
SCP_LOG(sc_core::SC_MEDIUM, __VA_ARGS__)
//! macro for warning level output
#define SCP_WARN(...) \
if (SCP_VBSTY_CHECK(sc_core::SC_LOW, ##__VA_ARGS__)) \
::scp::ScLogger<::sc_core::SC_WARNING>(__FILE__, __LINE__, \
sc_core::SC_MEDIUM) \
.type(SCP_GET_FEATURES(__VA_ARGS__)) \
.get() \
<< _SCP_FMT_EMPTY_STR
#define SCP_WARN(...) \
if (!(SCP_VBSTY_CHECK(sc_core::SC_LOW, ##__VA_ARGS__))) { \
} else \
::scp::ScLogger<::sc_core::SC_WARNING>(__FILE__, __LINE__, \
sc_core::SC_MEDIUM) \
.type(SCP_GET_FEATURES(__VA_ARGS__)) \
.get() \
<< _SCP_FMT_EMPTY_STR
//! macro for error level output
#define SCP_ERR(...) \
::scp::ScLogger<::sc_core::SC_ERROR>(__FILE__, __LINE__, \
Expand Down