[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Python SWIG for Win32

From: Dale Hirt <dale_at_sbcltd.com>
Date: 2003-02-13 23:12:17 CET

Hello all,

I have been hacking on the Python bindings, and it's been a bit of a beyatch
to say the least. However, I am starting to get there. I am simply stuck
on one portion of it.

Here's the error message:

swigging d:\work\svn_work\subversion\bindings\swig/svn_repos.i to
build\svn_repos.c
svn_repos.c
build\svn_repos.c(1677) : error C2632: 'long' followed by 'long' is illegal
D:\Programs\SWIG-1.3.17\swig.exe -c -python -noproxy
-Id:\work\svn_work\subversion\bindings\swig
-Id:\work\subversion\subversion\include -IC:\Apache\Apache2\include
-ID:\Programs\ActiveState\Python\2.2.2b224\include -o build\svn_repos.c
d:\work\svn_work\subversion\bindings\swig/svn_repos.i
C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD
/W3 /GX -Id:\work\svn_work\subversion\bindings\swig
-Id:\work\subversion\subversion\include -IC:\Apache\Apache2\include
-ID:\Programs\ActiveState\Python\2.2.2b224\include /Tcbuild\svn_repos.c
/Fobuild\temp.win32-2.2\Release\svn_repos.obj /D APR_STATIC /D WIN32 /D
APU_STATIC /D __WIN32__
error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe"'
failed with exit status 2

I tracked it down to these lines in svn_repos.c:

static PyObject *_wrap_svn_repos_dated_revision(PyObject *self, PyObject
*args) {
...
    apr_time_t arg3 ;
....
-> arg3 = (long long) PyLong_AsLongLong(obj1);
...
}

So then I tracked it down to these lines in apr.i:

/* -----------------------------------------------------------------------
   handle the mappings for apr_time_t

   Note: we don't generalize this to 'long long' since SWIG is starting
   to handle that.
*/

%apply long long { apr_time_t };

/* 'apr_time_t *' will always be an OUTPUT parameter */
%typemap(in,numinputs=0) apr_time_t * (apr_time_t temp)
    "$1 = &temp;";

%typemap(python,argout,fragment="t_output_helper") apr_time_t *
    "$result = t_output_helper($result, PyLong_FromLongLong(*$1));";

Since I am now in virgin territory wrt SWIG typemaps and apply's, can
someone help me make sense of all this. I have tried reading the swig
documentation, but it's almost as confusing as just reading the source code.

TIA,

Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Feb 13 23:12:58 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.