Permalink
Browse files

Fix modperl and modpython compilation.

Also fix few string-related inconsistences.
  • Loading branch information...
1 parent e06c3f5 commit 9fd4149d73e16473d0dbdbeb0fdc74545a215277 @DarthGandalf DarthGandalf committed Aug 14, 2012
@@ -20,6 +20,7 @@ class CClient;
class CBufLine {
public:
+ CBufLine() { throw 0; } // shouldn't be called, but is needed for compilation
CBufLine(const CString& sFormat, const CString& sText = "", const timeval* ts = 0);
~CBufLine();
CString GetLine(const CClient& Client, const MCString& msParams) const;
@@ -46,6 +47,8 @@ class CBufLine {
class CBuffer : private std::deque<CBufLine> {
public:
+ typedef typename std::deque<CBufLine>::size_type size_type;
+
CBuffer(unsigned int uLineCount = 100);
~CBuffer();
View
@@ -123,6 +123,8 @@ class CException {
*/
class CTable : protected std::vector<std::vector<CString> > {
public:
+ typedef typename std::vector<std::vector<CString> >::size_type size_type;
+
CTable() {}
virtual ~CTable() {}
@@ -11,7 +11,10 @@
%feature("naturalvar") CString;
-class CString;
+class CString {
+public:
+ typedef size_t size_type;
+};
/*@SWIG:/usr/share/swig1.3/typemaps/std_strings.swg,74,%typemaps_std_string@*/
@@ -37,6 +37,7 @@
#include "../include/znc/FileUtils.h"
#include "../include/znc/ZNCDebug.h"
#include "../include/znc/ExecSock.h"
+#include "../include/znc/Buffer.h"
#include "modperl/module.h"
#define stat struct stat
%}
@@ -50,6 +51,7 @@
%include <typemaps.i>
%include <stl.i>
%include <std_list.i>
+%include <std_deque.i>
namespace std {
template<class K> class set {
@@ -78,6 +80,8 @@ namespace std {
%template(VIRCNetworks) std::vector<CIRCNetwork*>;
%template(VChannels) std::vector<CChan*>;
+%template(VCString) std::vector<CString>;
+typedef std::vector<CString> VCString;
/*%template(MNicks) std::map<CString, CNick>;*/
/*%template(SModInfo) std::set<CModInfo>;
%template(SCString) std::set<CString>;
@@ -86,6 +90,8 @@ typedef std::set<CString> SCString;*/
class MCString : public std::map<CString, CString> {};
/*%template(PerlModulesVector) std::vector<CModule*>;*/
%template(VListeners) std::vector<CListener*>;
+%template(BufLines) std::deque<CBufLine>;
+%template(VVString) std::vector<VCString>;
%typemap(out) std::map<CString, CNick> {
HV* myhv = newHV();
@@ -124,6 +130,7 @@ class MCString : public std::map<CString, CString> {};
%include "../include/znc/Server.h"
%include "../include/znc/ZNCDebug.h"
%include "../include/znc/ExecSock.h"
+%include "../include/znc/Buffer.h"
%include "modperl/module.h"
@@ -11,7 +11,10 @@
%}
%feature("naturalvar") CString;
-class CString;
+class CString {
+public:
+typedef size_t size_type;
+};
/*@SWIG:/usr/share/swig1.3/typemaps/std_strings.swg,74,%typemaps_std_string@*/
@@ -48,6 +48,7 @@ using std::allocator;
%include <stl.i>
%include <std_list.i>
%include <std_set.i>
+%include <std_deque.i>
%include "modpython/cstring.i"
%template(_stringlist) std::list<CString>;
@@ -67,11 +68,15 @@ using std::allocator;
%template(SModInfo) std::set<CModInfo>;
%template(SCString) std::set<CString>;
typedef std::set<CString> SCString;
+%template(VCString) std::vector<CString>;
+typedef std::vector<CString> VCString;
%template(PyMCString) std::map<CString, CString>;
%template(PyMStringVString) std::map<CString, VCString>;
class MCString : public std::map<CString, CString> {};
%template(PyModulesVector) std::vector<CModule*>;
%template(VListeners) std::vector<CListener*>;
+%template(BufLines) std::deque<CBufLine>;
+%template(VVString) std::vector<VCString>;
%typemap(in) CString& {
String* p;

0 comments on commit 9fd4149

Please sign in to comment.