mirror of
https://github.com/fmtlib/fmt.git
synced 2025-12-02 07:09:44 +01:00
Fix modular build on clang
This commit is contained in:
13
src/fmt.cc
13
src/fmt.cc
@@ -1,9 +1,5 @@
|
||||
module;
|
||||
|
||||
#if !defined(WIN32_LEAN_AND_MEAN) && defined(_WIN32)
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
// Put all implementation-provided headers into the global module fragment
|
||||
// to prevent attachment to this module.
|
||||
#include <algorithm>
|
||||
@@ -54,22 +50,23 @@ module;
|
||||
# endif
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
export module fmt;
|
||||
|
||||
#define FMT_MODULE_EXPORT export
|
||||
#define FMT_EXPORT_BEGIN export {
|
||||
#define FMT_EXPORT_END }
|
||||
#define FMT_BEGIN_EXPORT export {
|
||||
#define FMT_END_EXPORT }
|
||||
#define FMT_BEGIN_DETAIL_NAMESPACE \
|
||||
} \
|
||||
namespace detail {
|
||||
#define FMT_END_DETAIL_NAMESPACE \
|
||||
} \
|
||||
export {
|
||||
// all library-provided declarations and definitions
|
||||
// must be in the module purview to be exported
|
||||
// All library-provided declarations and definitions must be in the module
|
||||
// purview to be exported.
|
||||
#include "fmt/args.h"
|
||||
#include "fmt/chrono.h"
|
||||
#include "fmt/color.h"
|
||||
|
||||
15
src/os.cc
15
src/os.cc
@@ -372,22 +372,22 @@ file file::open_windows_file(wcstring_view path, int oflag) {
|
||||
}
|
||||
# endif
|
||||
|
||||
#if !defined(__MSDOS__)
|
||||
# if !defined(__MSDOS__)
|
||||
long getpagesize() {
|
||||
# ifdef _WIN32
|
||||
# ifdef _WIN32
|
||||
SYSTEM_INFO si;
|
||||
GetSystemInfo(&si);
|
||||
return si.dwPageSize;
|
||||
# else
|
||||
# else
|
||||
long size = FMT_POSIX_CALL(sysconf(_SC_PAGESIZE));
|
||||
if (size < 0)
|
||||
FMT_THROW(system_error(errno, FMT_STRING("cannot get memory page size")));
|
||||
return size;
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
|
||||
FMT_BEGIN_DETAIL_NAMESPACE
|
||||
namespace detail {
|
||||
|
||||
void file_buffer::grow(size_t) {
|
||||
if (this->size() == this->capacity()) flush();
|
||||
@@ -410,8 +410,7 @@ file_buffer::~file_buffer() {
|
||||
flush();
|
||||
delete[] data();
|
||||
}
|
||||
|
||||
FMT_END_DETAIL_NAMESPACE
|
||||
} // namespace detail
|
||||
|
||||
ostream::~ostream() = default;
|
||||
#endif // FMT_USE_FCNTL
|
||||
|
||||
Reference in New Issue
Block a user