Skip to content

Commit 10a1ca5

Browse files
committed
fix compiler warnings
1 parent 949fb2a commit 10a1ca5

2 files changed

Lines changed: 20 additions & 7 deletions

File tree

build/android/utki/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ project(${name})
1515

1616
file(GLOB_RECURSE srcs "../../../src/utki/*.cpp")
1717

18-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
18+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
1919

2020
add_library(
2121
${name}

src/utki/debug.hpp

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ inline void log_debug(const std::function<void(std::ostream&)>& print)
9393
}
9494

9595
#else
96-
inline void log_debug(const std::function<void(std::ostream&)>& print) {}
96+
inline void log_debug(const std::function<void(std::ostream&)>&) {}
9797

9898
#endif
9999

@@ -134,7 +134,7 @@ inline void run_debug(const std::function<void()>& proc)
134134
}
135135

136136
#else
137-
inline void run_debug(const std::function<void()>& proc) {}
137+
inline void run_debug(const std::function<void()>&) {}
138138

139139
#endif
140140
} // namespace utki
@@ -258,24 +258,37 @@ inline void assert_always(
258258
* @param print - function providing information string to print in case the assertion fails.
259259
* @param source_location - location of the assert() invocation in the source code.
260260
*/
261+
#ifdef DEBUG
261262
inline void assert(
262263
bool condition,
263264
const std::function<void(std::ostream&)>& print,
264265
const utki::source_location& source_location
265-
#if CFG_CPP >= 20
266+
# if CFG_CPP >= 20
266267
= std_source_location::current()
267-
#endif
268+
# endif
268269
)
269270
{
270-
#ifdef DEBUG
271271
assert_always(
272272
condition, //
273273
print,
274274
source_location
275275
);
276-
#endif
277276
}
278277

278+
#else
279+
280+
inline void assert(
281+
bool,
282+
const std::function<void(std::ostream&)>&,
283+
const utki::source_location&
284+
# if CFG_CPP >= 20
285+
source_location = std_source_location::current()
286+
# endif
287+
)
288+
{}
289+
290+
#endif
291+
279292
/**
280293
* @brief Assert that condion is true.
281294
* In debug build this function invokes assert_always().

0 commit comments

Comments
 (0)