Skip to content

Commit 20c8fda

Browse files
author
anonymous
authored
Fix import std in clang++ (#4488)
fix module-compilation error when defined `FMT_IMPORT_STD`
1 parent 300ce75 commit 20c8fda

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/fmt/std.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ template <typename T> struct is_bit_reference_like {
225225

226226
// Workaround for libc++ incompatibility with C++ standard.
227227
// According to the Standard, `bitset::operator[] const` returns bool.
228-
#ifdef _LIBCPP_VERSION
228+
#if defined(_LIBCPP_VERSION) && !defined(FMT_IMPORT_STD)
229229
template <typename C>
230230
struct is_bit_reference_like<std::__bit_const_reference<C>> {
231231
static constexpr bool value = true;

src/fmt.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ module;
5050
# include <limits.h>
5151
# include <stdint.h>
5252
# include <stdio.h>
53+
# include <stdlib.h>
54+
# include <string.h>
5355
# include <time.h>
5456
#endif
5557
#include <cerrno>

0 commit comments

Comments
 (0)