Skip to content

Commit faee9c5

Browse files
committed
fix msvc compiler warnings
1 parent def4d07 commit faee9c5

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

src/utki/debug.hpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,24 +297,33 @@ inline void assert(
297297
* @param print - function providing information string to print in case the assertion fails.
298298
* @param source_location - location of the assert() invocation in the source code.
299299
*/
300+
#ifdef DEBUG
300301
inline void assert(
301302
const std::function<bool()>& condition_checker,
302303
const std::function<void(std::ostream&)>& print,
303304
const utki::source_location& source_location
304-
#if CFG_CPP >= 20
305+
# if CFG_CPP >= 20
305306
= std_source_location::current()
306-
#endif
307+
# endif
307308
)
308309
{
309-
// Do DEBUG macro check because condition checker function must not be invoked in non-debug build.
310-
#ifdef DEBUG
311310
assert(
312311
condition_checker(), //
313312
print,
314313
source_location
315314
);
316-
#endif
317315
}
316+
#else
317+
inline void assert(
318+
const std::function<bool()>&,
319+
const std::function<void(std::ostream&)>&,
320+
const utki::source_location&
321+
# if CFG_CPP >= 20
322+
source_location = std_source_location::current()
323+
# endif
324+
)
325+
{}
326+
#endif
318327

319328
/**
320329
* @brief Assert that condion is true.

0 commit comments

Comments
 (0)