mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-18 21:45:24 +00:00
workaround for msvc10 stl bug
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@34858 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2d1d9631a2
commit
7251a3a340
@ -17,6 +17,7 @@
|
||||
|
||||
#include "support/textutils.h"
|
||||
#include "support/docstring.h"
|
||||
#include "support/docstream.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
|
@ -23,6 +23,10 @@ using namespace std;
|
||||
|
||||
using lyx::ucs4_codeset;
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
||||
std::locale::id numpunct<lyx::char_type>::id;
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
// We use C IO throughout this file, because the facets might be used with
|
||||
|
@ -17,6 +17,14 @@
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
||||
// Ugly workaround for MSVC10 STL bug
|
||||
// http://connect.microsoft.com/VisualStudio/feedback/details/572376/msvc10-c-std-numpunct-has-a-hardcoded-dllimport-in-definition
|
||||
// std::numpunct has a hardcoded dllimport in definition, but we wanna it with 32 bit
|
||||
// so we can't import it and must define it but then the compiler complains.
|
||||
#include "support/numpunct_lyx_char_type.h"
|
||||
#endif
|
||||
|
||||
namespace lyx {
|
||||
|
||||
class iconv_codecvt_facet_exception : public std::exception {
|
||||
|
59
src/support/numpunct_lyx_char_type.h
Normal file
59
src/support/numpunct_lyx_char_type.h
Normal file
@ -0,0 +1,59 @@
|
||||
// -*- C++ -*-
|
||||
/**
|
||||
* \file numpunct_lyx_char_type.h
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author Peter Kümmel
|
||||
*
|
||||
* Full author contact details are available in file CREDITS.
|
||||
*/
|
||||
|
||||
#ifndef LYX_NUMPUNCT_LYX_CHAR_TYPE_H
|
||||
#define LYX_NUMPUNCT_LYX_CHAR_TYPE_H
|
||||
|
||||
|
||||
#include <locale>
|
||||
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
||||
template<>
|
||||
class numpunct<lyx::char_type> : public numpunct<char>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef lyx::char_type char_type;
|
||||
typedef basic_string<lyx::char_type> string_type;
|
||||
|
||||
static locale::id id;
|
||||
|
||||
explicit numpunct(size_t __refs = 0) : numpunct<char>(__refs)
|
||||
{}
|
||||
|
||||
char_type decimal_point() const
|
||||
{ return numpunct<char>::decimal_point(); }
|
||||
|
||||
char_type thousands_sep() const
|
||||
{ return numpunct<char>::thousands_sep(); }
|
||||
|
||||
string grouping() const
|
||||
{ return numpunct<char>::grouping(); }
|
||||
|
||||
string_type truename() const
|
||||
{ return lyx::from_ascii(numpunct<char>::truename()); }
|
||||
|
||||
string_type falsename() const
|
||||
{ return lyx::from_ascii(numpunct<char>::falsename()); }
|
||||
|
||||
|
||||
protected:
|
||||
virtual ~numpunct();
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user