Skip to content

Commit 0c67fee

Browse files
committed
Minor cleanup
1 parent e824477 commit 0c67fee

1 file changed

Lines changed: 16 additions & 18 deletions

File tree

src/os.cc

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

6262
namespace {
6363
#ifdef _WIN32
64+
6465
// Return type of read and write functions.
6566
using rwresult = int;
6667

@@ -69,20 +70,6 @@ using rwresult = int;
6970
inline unsigned convert_rwcount(size_t count) {
7071
return count <= UINT_MAX ? static_cast<unsigned>(count) : UINT_MAX;
7172
}
72-
#elif FMT_USE_FCNTL
73-
// Return type of read and write functions.
74-
using rwresult = ssize_t;
75-
76-
inline auto convert_rwcount(size_t count) -> size_t { return count; }
77-
#endif
78-
} // namespace
79-
80-
FMT_BEGIN_NAMESPACE
81-
82-
#ifdef _WIN32
83-
namespace detail {
84-
85-
namespace {
8673

8774
class system_message {
8875
system_message(const system_message&) = delete;
@@ -131,15 +118,25 @@ class utf8_system_category final : public std::error_category {
131118
}
132119
};
133120

134-
} // namespace
135-
136-
} // namespace detail
137-
138121
FMT_API const std::error_category& system_category() noexcept {
139122
static const detail::utf8_system_category category;
140123
return category;
141124
}
142125

126+
#elif FMT_USE_FCNTL
127+
128+
// Return type of read and write functions.
129+
using rwresult = ssize_t;
130+
131+
inline auto convert_rwcount(size_t count) -> size_t { return count; }
132+
133+
#endif
134+
} // namespace
135+
136+
FMT_BEGIN_NAMESPACE
137+
138+
#ifdef _WIN32
139+
143140
std::system_error vwindows_error(int err_code, string_view format_str,
144141
format_args args) {
145142
auto ec = std::error_code(err_code, system_category());
@@ -166,6 +163,7 @@ void detail::format_windows_error(detail::buffer<char>& out, int error_code,
166163
void report_windows_error(int error_code, const char* message) noexcept {
167164
do_report_error(detail::format_windows_error, error_code, message);
168165
}
166+
169167
#endif // _WIN32
170168

171169
buffered_file::~buffered_file() noexcept {

0 commit comments

Comments
 (0)