Revert rev 11187 "Merged with recent changes from trunk."
This reverts commit c595e4d90ebfd63eb55430c735bb121cf690bd59. Conflicts: Source/Modules/c.cxx From: William S Fulton <wsf@fultondesigns.co.uk> git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@13033 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
34a628c7c7
commit
d6b81eb831
703 changed files with 9266 additions and 21128 deletions
|
|
@ -19,4 +19,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -18,4 +18,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ InputName=example
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -c++ -python $(InputPath)
|
||||
..\..\..\swig -c++ -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
@ -141,7 +141,7 @@ InputName=example
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -c++ -python $(InputPath)
|
||||
..\..\..\swig -c++ -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@
|
|||
#include "example.h"
|
||||
%}
|
||||
|
||||
%typemap(in) double {
|
||||
/* hello */
|
||||
}
|
||||
|
||||
/* Let's just grab the original header file here */
|
||||
%include "example.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -17,4 +17,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -17,4 +17,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ InputName=example
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -python $(InputPath)
|
||||
..\..\..\swig -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ InputName=example
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -python $(InputPath)
|
||||
..\..\..\swig -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
|
|||
|
|
@ -21,4 +21,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -18,4 +18,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -18,4 +18,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -19,4 +19,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -19,4 +19,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -17,4 +17,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -17,4 +17,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -19,4 +19,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -19,4 +19,3 @@ clean::
|
|||
@rm -f foo.py bar.py spam.py base.py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ InputName=bar
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -c++ -python $(InputPath)
|
||||
..\..\..\swig -c++ -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ InputName=bar
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -c++ -python $(InputPath)
|
||||
..\..\..\swig -c++ -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ InputName=base
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -c++ -python $(InputPath)
|
||||
..\..\..\swig -c++ -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ InputName=base
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -c++ -python $(InputPath)
|
||||
..\..\..\swig -c++ -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ InputName=foo
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -c++ -python $(InputPath)
|
||||
..\..\..\swig -c++ -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ InputName=foo
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -c++ -python $(InputPath)
|
||||
..\..\..\swig -c++ -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ InputName=spam
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -c++ -python $(InputPath)
|
||||
..\..\..\swig -c++ -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ InputName=spam
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -c++ -python $(InputPath)
|
||||
..\..\..\swig -c++ -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
|
|||
|
|
@ -19,4 +19,3 @@ clean::
|
|||
@rm -f foo.py bar.py spam.py base.py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -17,4 +17,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -17,4 +17,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ InputName=example
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -python $(InputPath)
|
||||
..\..\..\swig -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ InputName=example
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -python $(InputPath)
|
||||
..\..\..\swig -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
|
|||
|
|
@ -27,24 +27,11 @@ extern int gcd(int x, int y);
|
|||
$2 = (char **) malloc(($1+1)*sizeof(char *));
|
||||
for (i = 0; i < $1; i++) {
|
||||
PyObject *s = PyList_GetItem($input,i);
|
||||
%#if PY_VERSION_HEX >= 0x03000000
|
||||
if (!PyUnicode_Check(s))
|
||||
%#else
|
||||
if (!PyString_Check(s))
|
||||
%#endif
|
||||
{
|
||||
if (!PyString_Check(s)) {
|
||||
free($2);
|
||||
SWIG_exception(SWIG_ValueError, "List items must be strings");
|
||||
}
|
||||
%#if PY_VERSION_HEX >= 0x03000000
|
||||
{
|
||||
int l;
|
||||
$2[i] = PyUnicode_AsStringAndSize(s, &l);
|
||||
}
|
||||
%#else
|
||||
$2[i] = PyString_AsString(s);
|
||||
%#endif
|
||||
|
||||
}
|
||||
$2[i] = 0;
|
||||
}
|
||||
|
|
@ -52,21 +39,12 @@ extern int gcd(int x, int y);
|
|||
extern int gcdmain(int argc, char *argv[]);
|
||||
|
||||
%typemap(in) (char *bytes, int len) {
|
||||
|
||||
%#if PY_VERSION_HEX >= 0x03000000
|
||||
if (!PyUnicode_Check($input)) {
|
||||
PyErr_SetString(PyExc_ValueError,"Expected a string");
|
||||
return NULL;
|
||||
}
|
||||
$1 = PyUnicode_AsStringAndSize($input, &$2);
|
||||
%#else
|
||||
if (!PyString_Check($input)) {
|
||||
PyErr_SetString(PyExc_ValueError,"Expected a string");
|
||||
return NULL;
|
||||
}
|
||||
$1 = PyString_AsString($input);
|
||||
$2 = PyString_Size($input);
|
||||
%#endif
|
||||
}
|
||||
|
||||
extern int count(char *bytes, int len, char c);
|
||||
|
|
@ -78,15 +56,9 @@ extern int count(char *bytes, int len, char c);
|
|||
so that we don't violate it's mutability */
|
||||
|
||||
%typemap(in) (char *str, int len) {
|
||||
%#if PY_VERSION_HEX >= 0x03000000
|
||||
$2 = PyUnicode_GetSize($input);
|
||||
$1 = (char *) malloc($2+1);
|
||||
memmove($1,PyUnicode_AsString($input),$2);
|
||||
%#else
|
||||
$2 = PyString_Size($input);
|
||||
$1 = (char *) malloc($2+1);
|
||||
memmove($1,PyString_AsString($input),$2);
|
||||
%#endif
|
||||
}
|
||||
|
||||
/* Return the mutated string as a new object. The t_output_helper
|
||||
|
|
@ -95,11 +67,7 @@ extern int count(char *bytes, int len, char c);
|
|||
|
||||
%typemap(argout) (char *str, int len) {
|
||||
PyObject *o;
|
||||
%#if PY_VERSION_HEX >= 0x03000000
|
||||
o = PyUnicode_FromStringAndSize($1,$2);
|
||||
%#else
|
||||
o = PyString_FromStringAndSize($1,$2);
|
||||
%#endif
|
||||
$result = t_output_helper($result,o);
|
||||
free($1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,4 +19,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -17,4 +17,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -18,4 +18,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -17,4 +17,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ InputName=example
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -python $(InputPath)
|
||||
..\..\..\swig -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ InputName=example
|
|||
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
|
||||
echo PYTHON_LIB: %PYTHON_LIB%
|
||||
echo on
|
||||
..\..\..\swig.exe -python $(InputPath)
|
||||
..\..\..\swig -python $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
|
|
|||
|
|
@ -19,4 +19,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -22,4 +22,3 @@ run:
|
|||
python runme.py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -23,5 +23,5 @@ namespace std {
|
|||
%template(halfi) half_map<std::string,int>;
|
||||
|
||||
|
||||
%template() std::pair<swig::SwigPtr_PyObject, swig::SwigPtr_PyObject>;
|
||||
%template(pymap) std::map<swig::SwigPtr_PyObject, swig::SwigPtr_PyObject>;
|
||||
%template() std::pair<swig::PyObject_ptr, swig::PyObject_ptr>;
|
||||
%template(pymap) std::map<swig::PyObject_ptr, swig::PyObject_ptr>;
|
||||
|
|
|
|||
|
|
@ -19,4 +19,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -22,4 +22,3 @@ clean::
|
|||
|
||||
check: all
|
||||
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -19,4 +19,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -17,4 +17,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -17,4 +17,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -19,4 +19,3 @@ clean::
|
|||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue