From 7ee913c8a82a75d0e6deca7cc32848fa2a5ed3e6 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Mon, 22 Jul 2013 16:10:31 +0100 Subject: [PATCH] Fix the SWIG warning in the SWIG interface files This keeps the .cpp and .h files clean. --- library/PolyVoxCore/include/PolyVoxCore/Region.h | 2 -- library/PolyVoxCore/source/Region.cpp | 4 +--- library/bindings/PolyVoxCore.i | 1 + library/bindings/Region.i | 4 ++++ 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Region.h b/library/PolyVoxCore/include/PolyVoxCore/Region.h index 74084c25..7312bc67 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Region.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Region.h @@ -204,9 +204,7 @@ namespace PolyVox // Non-member overloaded operators. /// Stream insertion operator. -#if !defined SWIG std::ostream& operator<<(std::ostream& os, const Region& region); -#endif // Functions to be inlined to to be in the header rather than the .cpp. // 'inline' keyword is used for the definition rather than the declaration. diff --git a/library/PolyVoxCore/source/Region.cpp b/library/PolyVoxCore/source/Region.cpp index d86c55cb..4ac22dbd 100644 --- a/library/PolyVoxCore/source/Region.cpp +++ b/library/PolyVoxCore/source/Region.cpp @@ -494,12 +494,10 @@ namespace PolyVox * \param region The Region to write to the stream. * \return A reference to the output stream to allow chaining. */ -#if !defined SWIG std::ostream& operator<<(std::ostream& os, const Region& region) { os << "(" << region.getLowerX() << "," << region.getLowerY() << "," << region.getLowerZ() << ") to (" << region.getUpperX() << "," << region.getUpperY() << "," << region.getUpperZ() << ")"; return os; } -#endif -} \ No newline at end of file +} diff --git a/library/bindings/PolyVoxCore.i b/library/bindings/PolyVoxCore.i index 30a71407..0a814a59 100644 --- a/library/bindings/PolyVoxCore.i +++ b/library/bindings/PolyVoxCore.i @@ -68,6 +68,7 @@ EXTRACTOR(shortname, LargeVolume) %ignore *::operator-=; %ignore *::operator*=; %ignore *::operator/=; +%ignore *::operator<<; //This is covered by STR() #endif %include "stdint.i" diff --git a/library/bindings/Region.i b/library/bindings/Region.i index 0860bf09..e57043af 100644 --- a/library/bindings/Region.i +++ b/library/bindings/Region.i @@ -4,6 +4,10 @@ #include "Region.h" %} +%extend PolyVox::Region { + STR() +}; + %ignore depth; %ignore height; %ignore width;