Skip to content

Commit ece375e

Browse files
committed
Fix compiler warnings
Do not definee NETWORK_ENABLE_LOGGING if already defined
1 parent f272cb4 commit ece375e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

logging/test/logging_log_record.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
#include <gtest/gtest.h>
99

1010
#include <network/logging/logging.hpp>
11-
#define NETWORK_ENABLE_LOGGING
11+
#ifndef NETWORK_ENABLE_LOGGING
12+
# define NETWORK_ENABLE_LOGGING
13+
#endif
1214
#include <network/detail/debug.hpp>
1315

1416
using namespace network::logging;
@@ -73,4 +75,4 @@ TEST(logging_log_record, macro_log) {
7375
NETWORK_MESSAGE("This is a log through the macro.");
7476
NETWORK_MESSAGE("This is a log through the macro, with a stream! Num="
7577
<< 42 << " - OK!");
76-
}
78+
}

message/src/network/detail/debug.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
1616
The user can force the logging to be enabled by defining NETWORK_ENABLE_LOGGING.
1717
*/
18-
#if defined(NETWORK_DEBUG) && defined(NETWORK_ENABLE_LOGGING)
18+
#if defined(NETWORK_DEBUG) && !defined(NETWORK_ENABLE_LOGGING)
1919
#define NETWORK_ENABLE_LOGGING
2020
#endif
2121

0 commit comments

Comments
 (0)