33 # undef __STRICT_ANSI__
51 # if defined(_WIN32) && !defined(__MINGW32__)
53 # define FMT_POSIX(call) _##call
55 # define FMT_POSIX(call) call
61 # define FMT_POSIX_CALL(call) FMT_SYSTEM(call)
63 # define FMT_SYSTEM(call) call
66 # define FMT_POSIX_CALL(call) ::_##call
68 # define FMT_POSIX_CALL(call) ::call
72 #if FMT_GCC_VERSION >= 407
73 # define FMT_UNUSED __attribute__((unused))
78 #ifndef FMT_USE_STATIC_ASSERT
79 # define FMT_USE_STATIC_ASSERT 0
82 #if FMT_USE_STATIC_ASSERT || FMT_HAS_FEATURE(cxx_static_assert) || \
83 (FMT_GCC_VERSION >= 403 && FMT_HAS_GXX_CXX11) || _MSC_VER >= 1600
84 # define FMT_STATIC_ASSERT(cond, message) static_assert(cond, message)
86 # define FMT_CONCAT_(a, b) FMT_CONCAT(a, b)
87 # define FMT_STATIC_ASSERT(cond, message) \
88 typedef int FMT_CONCAT_(Assert, __LINE__)[(cond) ? 1 : -1] FMT_UNUSED
94 # define FMT_RETRY_VAL(result, expression, error_result) \
96 result = (expression); \
97 } while (result == error_result && errno == EINTR)
99 # define FMT_RETRY_VAL(result, expression, error_result) result = (expression)
102 #define FMT_RETRY(result, expression) FMT_RETRY_VAL(result, expression, -1)
133 #if !FMT_USE_RVALUE_REFERENCES
223 explicit File(
int fd) : fd_(fd) {}
239 #if !FMT_USE_RVALUE_REFERENCES
313 std::size_t
read(
void *buffer, std::size_t count);
316 std::size_t
write(
const void *buffer, std::size_t count);
342 #if defined(LC_NUMERIC_MASK) || defined(_MSC_VER)
351 typedef _locale_t locale_t;
353 enum { LC_NUMERIC_MASK = LC_NUMERIC };
355 static locale_t newlocale(
int category_mask,
const char *locale, locale_t) {
356 return _create_locale(category_mask, locale);
359 static void freelocale(locale_t locale) {
360 _free_locale(locale);
363 static double strtod_l(
const char *nptr,
char **endptr, _locale_t locale) {
364 return _strtod_l(nptr, endptr, locale);
373 typedef locale_t
Type;
375 Locale() : locale_(newlocale(LC_NUMERIC_MASK,
"C",
NULL)) {
379 ~Locale() { freelocale(locale_); }
381 Type
get()
const {
return locale_; }
385 double strtod(
const char *&str)
const {
387 double result = strtod_l(str, &end, locale_);
395 #if !FMT_USE_RVALUE_REFERENCES
403 #endif // FMT_POSIX_H_
BufferedFile(Proxy p) FMT_NOEXCEPT
Definition: posix.h:146
BufferedFile & operator=(Proxy p)
Definition: posix.h:154
BufferedFile(FILE *f)
Definition: posix.h:124
arena_t NULL
Definition: jemalloc_internal.h:624
BufferedFile(BufferedFile &f) FMT_NOEXCEPT
Definition: posix.h:149
int value_
Definition: posix.h:109
File & operator=(Proxy p)
Definition: posix.h:260
int descriptor() const FMT_NOEXCEPT
Definition: posix.h:303
ErrorCode(int value=0) FMT_NOEXCEPT
Definition: posix.h:112
std::size_t write(const void *buffer, std::size_t count)
Definition: format.h:1396
#define FMT_POSIX(call)
Definition: posix.h:55
BasicCStringRef< char > CStringRef
Definition: format.h:523
File() FMT_NOEXCEPT
Definition: posix.h:234
File(Proxy p) FMT_NOEXCEPT
Definition: posix.h:252
BufferedFile fdopen(const char *mode)
BufferedFile() FMT_NOEXCEPT
Definition: posix.h:128
FILE * file
Definition: posix.h:141
FILE * file_
Definition: posix.h:120
File & operator=(File &other)
Definition: posix.h:267
FMT_API void print(std::FILE *f, CStringRef format_str, ArgList args)
static void pipe(File &read_end, File &write_end)
File(int fd)
Definition: posix.h:223
const FieldDescriptor value
Definition: descriptor.h:1522
Definition: format.h:2147
#define const
Definition: zconf.h:217
std::size_t read(void *buffer, std::size_t count)
~BufferedFile() FMT_NOEXCEPT
BufferedFile & operator=(BufferedFile &other)
Definition: posix.h:161
Type
Type of JSON value.
Definition: rapidjson.h:642
void print(CStringRef format_str, const ArgList &args)
Definition: posix.h:206
File(File &other) FMT_NOEXCEPT
Definition: posix.h:255
FMT_GCC_EXTENSION typedef long long LongLong
Definition: format.h:361
int fd
Definition: posix.h:247
int fd_
Definition: posix.h:220