Add <string> fragment

Removes <string> include specifically for clang
Cuts down on duplicate #include <string> in general
This commit is contained in:
William S Fulton 2014-02-15 23:30:14 +00:00
commit bd5c340062
9 changed files with 17 additions and 32 deletions

View file

@ -8,9 +8,8 @@
%apply size_t { std::size_t };
%fragment("<string>");
%{
#include <string>
double SwigSvToNumber(SV* sv) {
return SvIOK(sv) ? double(SvIVX(sv)) : SvNVX(sv);
}

View file

@ -195,9 +195,8 @@ namespace swig {
//
#ifdef SWIG_PYTHON_BACKWARD_COMP
%fragment("<string>");
%{
#include <string>
PyObject* SwigInt_FromBool(bool b) {
return PyInt_FromLong(b ? 1L : 0L);
}

View file

@ -3,10 +3,7 @@
%include <std_alloc.i>
%include <std_char_traits.i>
%{
#include <string>
%}
%fragment("<string>");
namespace std
{

View file

@ -23,8 +23,8 @@
// Common code for supporting the C++ std namespace
//
%fragment("<string>");
%{
#include <string>
#include <stdexcept>
#include <stddef.h>
%}
@ -73,13 +73,7 @@ namespace std {
#endif
%}
%fragment("StdStringInclude","header") %{
#ifdef __clang__
#include <string>
#endif
%}
%fragment("StdTraitsCommon","header",fragment="StdStringInclude") %{
%fragment("StdTraitsCommon","header",fragment="<string>") %{
namespace swig {
template <class Type>
struct noconst_traits {

View file

@ -28,11 +28,11 @@
// is returned
// ------------------------------------------------------------------------
%fragment("<string>");
%{
#include <vector>
#include <algorithm>
#include <stdexcept>
#include <string>
Tcl_Obj* SwigString_FromString(const std::string &s) {
return Tcl_NewStringObj(s.data(), (int)s.length());

View file

@ -149,8 +149,12 @@
#endif
%}
%fragment("<stddef.h>", "header") %{
#include <stddef.h>
%fragment("<stddef.h>", "header") %{
#include <stddef.h>
%}
%fragment("<string>", "header") %{
#include <string>
%}
%fragment("SWIG_isfinite","header",fragment="<math.h>,<float.h>") %{

View file

@ -8,10 +8,8 @@
%include <typemaps/std_strings.swg>
%{
#include <string>
%}
%fragment("<string>");
namespace std
{
%naturalvar string;

View file

@ -7,8 +7,8 @@
%{
#include <cwchar>
#include <string>
%}
%fragment("<string>");
namespace std
{

View file

@ -21,18 +21,12 @@
// Common code for supporting the STD C++ namespace
//
%fragment("<string>");
%{
#include <string>
#include <stdexcept>
%}
%fragment("StdStringInclude","header") %{
#ifdef __clang__
#include <string>
#endif
%}
%fragment("Traits","header",fragment="StdStringInclude")
%fragment("Traits","header",fragment="<string>")
{
namespace swig {
/*