On 05/29/2012 08:41 AM, William S Fulton wrote:

There are some problems with 'using' statements in SWIG and so the
commit you highlighted might have exposed these problems. I'll take a
closer look later, but in the meantime, could you please consider the
following workaround for ZNC where you explicitly qualify std::pair.

%include<stl.i>
%template(StrPair) std::pair<std::string, std::string>;

The attached patch does just that and fixes the build for me. I forwarded the patch to the upstream issue as well.

Please consider applying until SWIG gets fixed.

Greetings, Torsten

Description: Qualify access to pair with std:: for SWIG.
 SWIG seems to have problems with access to imported C++ namespaces.
 William S. Fulton suggested to work around this by qualifying std::pair
 in this email:
 http://article.gmane.org/gmane.comp.programming.swig.devel/21772
 .
 This patch does just that and seems to fix building with SWIG 2.0.7.
 In the long run this should of course be fixed in SWIG.
Author: Torsten Landschoff <tors...@debian.org>
Bug-Debian: http://bugs.debian.org/672035
Forwarded: https://github.com/znc/znc/issues/174

--- znc-0.206.orig/modules/modpython/modpython.i
+++ znc-0.206/modules/modpython/modpython.i
@@ -174,10 +174,10 @@ public:
 
 /* Web */
 
-%template(StrPair) pair<CString, CString>;
-%template(VPair) vector<pair<CString, CString> >;
-typedef vector<pair<CString, CString> > VPair;
-%template(VWebSubPages) vector<TWebSubPage>;
+%template(StrPair) std::pair<CString, CString>;
+%template(VPair) std::vector<std::pair<CString, CString> >;
+typedef std::vector<std::pair<CString, CString> > VPair;
+%template(VWebSubPages) std::vector<TWebSubPage>;
 
 %inline %{
 	void VPair_Add2Str_(VPair* self, const CString& a, const CString& b) {

Reply via email to