Skip to content

Commit

Permalink
modules missing pieces
Browse files Browse the repository at this point in the history
- don't export names from `detail`
- put more headers into the global module fragment
- support MSYS2 and Clang
  • Loading branch information
DanielaE committed Apr 23, 2023
1 parent 18154cc commit b19310b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1039,10 +1039,10 @@ template <typename T, size_t SIZE, typename Allocator>
struct is_contiguous<basic_memory_buffer<T, SIZE, Allocator>> : std::true_type {
};

namespace detail {
FMT_BEGIN_DETAIL_NAMESPACE
FMT_API bool write_console(std::FILE* f, string_view text);
FMT_API void print(std::FILE*, string_view);
} // namespace detail
FMT_END_DETAIL_NAMESPACE

// Suppress a misleading warning in older versions of clang.
#if FMT_CLANG_VERSION
Expand Down
16 changes: 13 additions & 3 deletions src/fmt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ module;
#include <system_error>
#include <thread>
#include <type_traits>
#include <typeinfo>
#include <utility>
#include <variant>
#include <vector>
#include <version>

#if _MSC_VER
#if __has_include(<cxxabi.h>)
# include <cxxabi.h>
#endif
#if defined(_MSC_VER) || defined(__MINGW32__)
# include <intrin.h>
#endif
#if defined __APPLE__ || defined(__FreeBSD__)
Expand All @@ -56,6 +60,12 @@ module;
# endif
#endif
#ifdef _WIN32
# if defined(__GLIBCXX__)
# include <ext/stdio_filebuf.h>
# include <ext/stdio_sync_filebuf.h>
# elif defined(_LIBCPP_VERSION)
# include <__std_stream>
# endif
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif
Expand All @@ -80,12 +90,12 @@ export module fmt;
#include "fmt/format.h"
#include "fmt/os.h"
#include "fmt/printf.h"
#include "fmt/xchar.h"
#include "fmt/std.h"
#include "fmt/xchar.h"

// gcc doesn't yet implement private module fragments
#if !FMT_GCC_VERSION
module : private;
module :private;
#endif

#include "format.cc"
Expand Down

0 comments on commit b19310b

Please sign in to comment.