2
3
4
5
6
7
8
13#if defined(__MINGW32__) || defined(__CYGWIN__)
15# undef __STRICT_ANSI__
26#if defined __APPLE__ || defined(__FreeBSD__)
33# if defined(_WIN32
) && !defined(__MINGW32__)
35# define FMT_POSIX(call) _##call
37# define FMT_POSIX(call) call
43# define FMT_POSIX_CALL(call) FMT_SYSTEM(call)
45# define FMT_SYSTEM(call) call
48# define FMT_POSIX_CALL(call) ::_##call
50# define FMT_POSIX_CALL(call) ::call
57# define FMT_RETRY_VAL(result, expression, error_result)
59 result = (expression);
60 } while (result == error_result && errno == EINTR)
62# define FMT_RETRY_VAL(result, expression, error_result) result = (expression)
65#define FMT_RETRY(result, expression) FMT_RETRY_VAL(result, expression, -1
)
169 void print(CStringRef format_str,
const ArgList &args) {
170 fmt::print(
file_, format_str, args);
305#if (defined(LC_NUMERIC_MASK) || defined(_MSC_VER
)) &&
306 !defined(__ANDROID__) && !defined(__CYGWIN__)
315 typedef _locale_t locale_t;
317 enum { LC_NUMERIC_MASK = LC_NUMERIC };
319 static locale_t newlocale(
int category_mask,
const char *locale, locale_t) {
320 return _create_locale(category_mask, locale);
323 static void freelocale(locale_t locale) {
324 _free_locale(locale);
327 static double strtod_l(
const char *nptr,
char **endptr, _locale_t locale) {
328 return _strtod_l(nptr, endptr, locale);
337 typedef locale_t Type;
339 Locale() : locale_(newlocale(LC_NUMERIC_MASK,
"C",
FMT_NULL)) {
343 ~Locale() { freelocale(locale_); }
345 Type get()
const {
return locale_; }
349 double strtod(
const char *&str)
const {
351 double result = strtod_l(str, &end, locale_);
362inline fmt::BufferedFile &move(fmt::BufferedFile &f) {
return f; }
363inline fmt::File &move(fmt::File &f) {
return f; }
FILE * get() const FMT_NOEXCEPT
FMT_API ~BufferedFile() FMT_NOEXCEPT
BufferedFile() FMT_NOEXCEPT
FMT_API BufferedFile(CStringRef filename, CStringRef mode)
void print(CStringRef format_str, const ArgList &args)
FMT_API int fileno() const
int get() const FMT_NOEXCEPT
ErrorCode(int value=0) FMT_NOEXCEPT
FMT_API std::size_t write(const void *buffer, std::size_t count)
int descriptor() const FMT_NOEXCEPT
static FMT_API File dup(int fd)
FMT_API void dup2(int fd, ErrorCode &ec) FMT_NOEXCEPT
FMT_API void dup2(int fd)
static FMT_API void pipe(File &read_end, File &write_end)
FMT_API ~File() FMT_NOEXCEPT
FMT_API BufferedFile fdopen(const char *mode)
FMT_API std::size_t read(void *buffer, std::size_t count)
FMT_API LongLong size() const
FMT_API File(CStringRef path, int oflag)
#define FMT_RETRY_VAL(result, expression, error_result)
#define FMT_RETRY(result, expression)
#define FMT_POSIX_CALL(call)