From 990446c0e1d784ef9e067f109d4eaef08a9237b4 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Tue, 20 Oct 2015 21:23:01 +0200 Subject: [PATCH] msvc: Move implementation of numpunct<> functions to cpp file These functions use lyx::from_ascii which means they need to include docstring.h, but that results in a circular include. --- src/support/docstream.cpp | 19 ++++++++++++++++++- src/support/numpunct_lyx_char_type.h | 8 +++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/support/docstream.cpp b/src/support/docstream.cpp index f6548e139f..b07ac56a32 100644 --- a/src/support/docstream.cpp +++ b/src/support/docstream.cpp @@ -28,7 +28,24 @@ using lyx::ucs4_codeset; #if defined(_MSC_VER) && (_MSC_VER >= 1600) std::locale::id numpunct::id; -#endif + +namespace std { +// Implementation of numpunct defined in numpunct_lyx_char_type.h +typedef basic_string string_type; + +string_type numpunct::truename() const +{ + return lyx::from_ascii(numpunct::truename()); +} + +string_type numpunct::falsename() const +{ + return lyx::from_ascii(numpunct::falsename()); +} + +} // namespace std + +#endif // _MSC_VER >= 1600 namespace { diff --git a/src/support/numpunct_lyx_char_type.h b/src/support/numpunct_lyx_char_type.h index 6ef22e61e4..b3f6cdea28 100644 --- a/src/support/numpunct_lyx_char_type.h +++ b/src/support/numpunct_lyx_char_type.h @@ -41,11 +41,9 @@ namespace std string grouping() const { return numpunct::grouping(); } - string_type truename() const - { return lyx::from_ascii(numpunct::truename()); } - - string_type falsename() const - { return lyx::from_ascii(numpunct::falsename()); } + // Implementation can be found in docstream.cpp + string_type truename() const; + string_type falsename() const; protected: -- 2.39.2