Skip to content

Commit 78c794d

Browse files
committed
Check whether <format> exists
1 parent 4f9a27b commit 78c794d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/tinyopt/formatters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#include <tinyopt/traits.h>
2525

26-
#if __cplusplus >= 202002L
26+
#if (__cplusplus >= 202002L) && __has_include(<format>)
2727

2828
template <typename T>
2929
struct TINYOPT_FORMAT_NS::formatter<

include/tinyopt/log.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define TINYOPT_LOG(...) fmt::print(__VA_ARGS__);
2828
#define TINYOPT_FORMAT_NS fmt
2929

30-
#elif __cplusplus >= 202002L
30+
#elif (__cplusplus >= 202002L) && __has_include(<format>)
3131

3232
#include <format>
3333

0 commit comments

Comments
 (0)