allow to use iostream and sstream without wchar support, as pointed by Scott
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7138 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5702970de9
commit
d1bec74c9c
4 changed files with 27 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
#if !defined(SWIG_STD_STRING) && !defined(SWIG_STD_WSTRING)
|
#if !defined(SWIG_STD_STRING)
|
||||||
#define SWIG_STD_BASIC_STRING
|
#define SWIG_STD_BASIC_STRING
|
||||||
|
|
||||||
%include <pycontainer.swg>
|
%include <pycontainer.swg>
|
||||||
|
|
@ -45,6 +45,13 @@ SWIGINTERNINLINE PyObject*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%include <std/std_basic_string.i>
|
||||||
|
%typemap_asptrfromn(SWIG_CCode(STRING), std::basic_string<char>);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(SWIG_STD_WSTRING)
|
||||||
|
|
||||||
%fragment(SWIG_AsPtr_frag(std::basic_string<wchar_t>),"header",
|
%fragment(SWIG_AsPtr_frag(std::basic_string<wchar_t>),"header",
|
||||||
fragment="SWIG_AsWCharPtrAndSize") {
|
fragment="SWIG_AsWCharPtrAndSize") {
|
||||||
|
|
@ -87,11 +94,6 @@ SWIGINTERNINLINE PyObject*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%include <std/std_basic_string.i>
|
|
||||||
|
|
||||||
%typemap_asptrfromn(SWIG_CCode(STRING), std::basic_string<char>);
|
|
||||||
%typemap_asptrfromn(SWIG_CCode(UNISTRING), std::basic_string<wchar_t>);
|
%typemap_asptrfromn(SWIG_CCode(UNISTRING), std::basic_string<wchar_t>);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,21 @@
|
||||||
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
%{
|
||||||
|
#include <cwchar>
|
||||||
|
%}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
%{
|
%{
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%types(wchar_t *);
|
#endif
|
||||||
|
|
||||||
|
%types(wchar_t *);
|
||||||
%include <pywstrings.swg>
|
%include <pywstrings.swg>
|
||||||
|
|
||||||
|
/*
|
||||||
|
Enable swig wchar support.
|
||||||
|
*/
|
||||||
|
#define SWIG_WCHAR
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,9 @@ namespace std {
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
%template(ios) basic_ios<char>;
|
%template(ios) basic_ios<char>;
|
||||||
|
#if defined(SWIG_WCHAR)
|
||||||
%template(wios) basic_ios<wchar_t>;
|
%template(wios) basic_ios<wchar_t>;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,5 +81,7 @@ namespace std {
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
%template(streambuf) basic_streambuf<char>;
|
%template(streambuf) basic_streambuf<char>;
|
||||||
|
#if defined(SWIG_WCHAR)
|
||||||
%template(wstreambuf) basic_streambuf<wchar_t>;
|
%template(wstreambuf) basic_streambuf<wchar_t>;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue