Skip to content

Commit 87f88bf

Browse files
committed
Fix TU-local entity exposition errors in GCC 15
1 parent 5928feb commit 87f88bf

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

include/fmt/format-inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ inline auto floor_log10_pow2_minus_log10_4_over_3(int e) noexcept -> int {
212212
return (e * 631305 - 261663) >> 21;
213213
}
214214

215-
FMT_INLINE_VARIABLE constexpr struct {
215+
FMT_INLINE_VARIABLE constexpr struct div_small_pow10_infos_struct {
216216
uint32_t divisor;
217217
int shift_amount;
218218
} div_small_pow10_infos[] = {{10, 16}, {100, 16}};

src/os.cc

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,12 @@
6161

6262
namespace {
6363
#ifdef _WIN32
64-
// Return type of read and write functions.
65-
using rwresult = int;
66-
6764
// On Windows the count argument to read and write is unsigned, so convert
6865
// it from size_t preventing integer overflow.
6966
inline unsigned convert_rwcount(std::size_t count) {
7067
return count <= UINT_MAX ? static_cast<unsigned>(count) : UINT_MAX;
7168
}
7269
#elif FMT_USE_FCNTL
73-
// Return type of read and write functions.
74-
using rwresult = ssize_t;
75-
7670
inline std::size_t convert_rwcount(std::size_t count) { return count; }
7771
#endif
7872
} // namespace
@@ -266,6 +260,14 @@ long long file::size() const {
266260
# endif
267261
}
268262

263+
264+
// Return type of read and write functions.
265+
# ifdef _WIN32
266+
# define rwresult int
267+
# elif FMT_USE_FCNTL
268+
# define rwresult ssize_t
269+
# endif
270+
269271
std::size_t file::read(void* buffer, std::size_t count) {
270272
rwresult result = 0;
271273
FMT_RETRY(result, FMT_POSIX_CALL(read(fd_, buffer, convert_rwcount(count))));
@@ -282,6 +284,8 @@ std::size_t file::write(const void* buffer, std::size_t count) {
282284
return detail::to_unsigned(result);
283285
}
284286

287+
# undef rwresult
288+
285289
file file::dup(int fd) {
286290
// Don't retry as dup doesn't return EINTR.
287291
// http://pubs.opengroup.org/onlinepubs/009695399/functions/dup.html

0 commit comments

Comments
 (0)