Permalink
Browse files

Bump SWIG req to 2.0.8, remove our hacks around old SWIG.

  • Loading branch information...
1 parent 071801a commit da5c6b6a8b6534808d89c988b845fefbed9c686e @DarthGandalf DarthGandalf committed Nov 6, 2012
View
@@ -354,7 +354,7 @@ fi
if test "x$PERL" != xno -o "x$PYTHON" != xno; then
old_USESWIG="$USESWIG"
if test "x$USESWIG" != "xno"; then
- AC_PROG_SWIG([2.0.4])
+ AC_PROG_SWIG([2.0.8])
test -z "$SWIG" && USESWIG=no
if test "x$USESWIG" = xno -a "x$old_USESWIG" = yes; then
AC_MSG_ERROR([Could not found appropriate SWIG installation. Check config.log for details.])
View
@@ -123,15 +123,15 @@ AC_DEFUN([AC_PROG_SWIG],[
# "python 3 abc set", "PyInt_FromSize_t in python3" and "perl size_type" checks
echo "checking behavior of this SWIG" >&AS_MESSAGE_LOG_FD
- $ac_path_SWIG -python -py3 -c++ -shadow -I"$srcdir"/swig_lib/python conftest-python.i >&AS_MESSAGE_LOG_FD && \
+ $ac_path_SWIG -python -py3 -c++ -shadow conftest-python.i >&AS_MESSAGE_LOG_FD && \
echo "python wrapper created" >&AS_MESSAGE_LOG_FD && \
echo "testing std::set... ">&AS_MESSAGE_LOG_FD && \
grep SInt_discard conftest.py >& /dev/null && \
echo "std::set works" >&AS_MESSAGE_LOG_FD && \
echo "testing PyInt_FromSize_t..." >&AS_MESSAGE_LOG_FD && \
grep '#define PyInt_FromSize_t' conftest-python_wrap.cxx >& /dev/null && \
echo "PyInt_FromSize_t is defined" >&AS_MESSAGE_LOG_FD && \
- $ac_path_SWIG -perl -c++ -shadow -I"$srcdir"/swig_lib/perl5 conftest-perl.i >&AS_MESSAGE_LOG_FD && \
+ $ac_path_SWIG -perl -c++ -shadow conftest-perl.i >&AS_MESSAGE_LOG_FD && \
echo "perl wrapper created" >&AS_MESSAGE_LOG_FD && \
echo "testing size_type..." >&AS_MESSAGE_LOG_FD && \
test 0 -eq `grep -c 'NewPointerObj((' conftest-perl_wrap.cxx` && \
@@ -26,7 +26,7 @@ modperl/swigperlrun.h:
modperl/ZNC.cpp: modperl/modperl.i modperl/module.h modperl/CString.i
$(E) Generating ZNC API for Perl...
@mkdir -p modperl .depend
- $(Q)$(SWIG) -perl5 -c++ -shadow -outdir modperl -I$(srcdir) -I$(srcdir)/../swig_lib/perl5 -MD -MF .depend/modperl.swig.dep -w362,315,401,402 -o $@ $<
+ $(Q)$(SWIG) -perl5 -c++ -shadow -outdir modperl -I$(srcdir) -MD -MF .depend/modperl.swig.dep -w362,315,401,402 -o $@ $<
modperl/ZNC.pm: modperl/ZNC.cpp
@@ -26,7 +26,7 @@ modpython/swigpyrun.h:
modpython/_znc_core.cpp: modpython/modpython.i modpython/module.h modpython/cstring.i
$(E) Generating ZNC API for python...
@mkdir -p modpython .depend
- $(Q)$(SWIG) -python -py3 -c++ -shadow -outdir modpython -I$(srcdir) -I$(srcdir)/../swig_lib/python -MD -MF .depend/modpython.swig.dep -w362,315,401 -o $@ $<
+ $(Q)$(SWIG) -python -py3 -c++ -shadow -outdir modpython -I$(srcdir) -MD -MF .depend/modpython.swig.dep -w362,315,401 -o $@ $<
modpython/znc_core.py: modpython/_znc_core.cpp
View
@@ -1,135 +0,0 @@
-/* -----------------------------------------------------------------------------
- * _std_deque.i
- *
- * This file contains a generic definition of std::deque along with
- * some helper functions. Specific language modules should include
- * this file to generate wrappers.
- * ----------------------------------------------------------------------------- */
-
-%include <std_except.i>
-
-%{
-#include <deque>
-#include <stdexcept>
-%}
-
-
-/* This macro defines all of the standard methods for a deque. This
- is defined as a macro to simplify the task of specialization. For
- example,
-
- template<> class deque<int> {
- public:
- %std_deque_methods(int);
- };
-*/
-
-%define %std_deque_methods_noempty(T)
- typedef T &reference;
- typedef const T& const_reference;
- typedef size_t size_type;
-
- deque();
- deque(unsigned int size, const T& value=T());
- deque(const deque<T> &);
- ~deque();
-
- void assign(unsigned int n, const T& value);
- void swap(deque<T> &x);
- unsigned int size() const;
- unsigned int max_size() const;
- void resize(unsigned int n, T c = T());
- const_reference front();
- const_reference back();
- void push_front(const T& x);
- void push_back(const T& x);
- void pop_front();
- void pop_back();
- void clear();
-
- /* Some useful extensions */
- %extend {
- const_reference getitem(int i) throw (std::out_of_range) {
- int size = int(self->size());
- if (i<0) i += size;
- if (i>=0 && i<size)
- return (*self)[i];
- else
- throw std::out_of_range("deque index out of range");
- }
- void setitem(int i, const T& x) throw (std::out_of_range) {
- int size = int(self->size());
- if (i<0) i+= size;
- if (i>=0 && i<size)
- (*self)[i] = x;
- else
- throw std::out_of_range("deque index out of range");
- }
- void delitem(int i) throw (std::out_of_range) {
- int size = int(self->size());
- if (i<0) i+= size;
- if (i>=0 && i<size) {
- self->erase(self->begin()+i);
- } else {
- throw std::out_of_range("deque index out of range");
- }
- }
- std::deque<T> getslice(int i, int j) {
- int size = int(self->size());
- if (i<0) i = size+i;
- if (j<0) j = size+j;
- if (i<0) i = 0;
- if (j>size) j = size;
- std::deque<T > tmp(j-i);
- std::copy(self->begin()+i,self->begin()+j,tmp.begin());
- return tmp;
- }
- void setslice(int i, int j, const std::deque<T>& v) {
- int size = int(self->size());
- if (i<0) i = size+i;
- if (j<0) j = size+j;
- if (i<0) i = 0;
- if (j>size) j = size;
- if (int(v.size()) == j-i) {
- std::copy(v.begin(),v.end(),self->begin()+i);
- } else {
- self->erase(self->begin()+i,self->begin()+j);
- if (i+1 <= size)
- self->insert(self->begin()+i+1,v.begin(),v.end());
- else
- self->insert(self->end(),v.begin(),v.end());
- }
- }
- void delslice(int i, int j) {
- int size = int(self->size());
- if (i<0) i = size+i;
- if (j<0) j = size+j;
- if (i<0) i = 0;
- if (j>size) j = size;
- self->erase(self->begin()+i,self->begin()+j);
- }
- };
-%enddef
-
-#ifdef SWIGPHP
-%define %std_deque_methods(T)
- %extend {
- bool is_empty() const {
- return self->empty();
- }
- };
- %std_deque_methods_noempty(T)
-%enddef
-#else
-%define %std_deque_methods(T)
- bool empty() const;
- %std_deque_methods_noempty(T)
-%enddef
-#endif
-
-namespace std {
- template<class T> class deque {
- public:
- %std_deque_methods(T);
- };
-}
Oops, something went wrong.

1 comment on commit da5c6b6

Contributor

md-5 commented on da5c6b6 Nov 23, 2012

Nice to see some of that code gone.

Please sign in to comment.