mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-03 15:41:53 +01:00
Merge branch 'master' into update-project-layout
Conflicts: posix.h
This commit is contained in:
@@ -335,7 +335,10 @@ class File {
|
||||
long getpagesize();
|
||||
|
||||
#if defined(LC_NUMERIC_MASK) || defined(_MSC_VER)
|
||||
# define FMT_LOCALE
|
||||
#endif
|
||||
|
||||
#ifdef FMT_LOCALE
|
||||
// A "C" numeric locale.
|
||||
class Locale {
|
||||
private:
|
||||
@@ -362,13 +365,15 @@ class Locale {
|
||||
FMT_DISALLOW_COPY_AND_ASSIGN(Locale);
|
||||
|
||||
public:
|
||||
typedef locale_t Type;
|
||||
|
||||
Locale() : locale_(newlocale(LC_NUMERIC_MASK, "C", NULL)) {
|
||||
if (!locale_)
|
||||
throw fmt::SystemError(errno, "cannot create locale");
|
||||
}
|
||||
~Locale() { freelocale(locale_); }
|
||||
|
||||
locale_t get() const { return locale_; }
|
||||
Type get() const { return locale_; }
|
||||
|
||||
// Converts string to floating-point number and advances str past the end
|
||||
// of the parsed input.
|
||||
@@ -379,8 +384,7 @@ class Locale {
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // LC_NUMERIC
|
||||
#endif // FMT_LOCALE
|
||||
} // namespace fmt
|
||||
|
||||
#if !FMT_USE_RVALUE_REFERENCES
|
||||
|
||||
Reference in New Issue
Block a user