mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
build with msvc10. Seems there is a bug in their STL code:
// 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. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34262 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
aaf7bfd231
commit
e948caf637
@ -23,6 +23,12 @@ 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
|
||||
|
@ -14,6 +14,13 @@
|
||||
|
||||
#include "support/docstring.h"
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
||||
// Ugly workaround for MSVC10 STL bug:
|
||||
// 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
|
||||
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
@ -68,9 +75,6 @@ public:
|
||||
};
|
||||
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
||||
extern template class std::numpunct<lyx::char_type>;
|
||||
#endif
|
||||
|
||||
/// UCS4 input stringstream
|
||||
typedef std::basic_istringstream<char_type> idocstringstream;
|
||||
|
64
src/support/numpunct_lyx_char_type.h
Normal file
64
src/support/numpunct_lyx_char_type.h
Normal file
@ -0,0 +1,64 @@
|
||||
// -*- 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 locale::facet
|
||||
{
|
||||
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) : chared(__refs)
|
||||
{}
|
||||
|
||||
char_type decimal_point() const
|
||||
{ return chared.decimal_point(); }
|
||||
|
||||
char_type thousands_sep() const
|
||||
{ return chared.thousands_sep(); }
|
||||
|
||||
string grouping() const
|
||||
{ return chared.grouping(); }
|
||||
|
||||
string_type truename() const
|
||||
{ return lyx::from_ascii(chared.truename()); }
|
||||
|
||||
string_type falsename() const
|
||||
{ return lyx::from_ascii(chared.falsename()); }
|
||||
|
||||
|
||||
protected:
|
||||
virtual ~numpunct();
|
||||
|
||||
|
||||
private:
|
||||
numpunct<char> chared;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user