There are a number of build warnings on Win32 that I have been looking at. While some are no doubt windows-specific, some look to be generic C programming errors. Is there a goal of getting to a warning-free build?

Two changes to mod_python.h remove a number of the warnings. The first change is for Win32, and involves having the right flavor of DL_IMPORT in play. DL_IMPORT is a deprecated pyport.h macro (from python) that lets users of DLL functions get the correct external declaration while implementors of these functions get the correct internal declaration.

The second change is to fix the declaration of mp_release_interpreter which is a void, not a void *. I doubt this matters but it is an error. APR_DECLARE_OPTIONAL_FN(void, mp_release_interpreter, ());

The remaining build warnings are attached in a txt file for anyone who cares. I assume many are innocuous, but there are things like python_filter() and python_input_filter() using different types for their readbytes argument that I don't understand. Why should these two functions declare this arg differently?

- Jeff
----- Original Message ----- From: "Graham Dumpleton" <[EMAIL PROTECTED]>
To: "Jeff Robbins" <[EMAIL PROTECTED]>
Cc: <python-dev@httpd.apache.org>
Sent: Tuesday, November 14, 2006 6:03 PM
Subject: Re: mod_python 3.3.0-dev-20061109 tests on Win32


Jeff, can you download:


http://svn.apache.org/viewvc/httpd/mod_python/trunk/dist/setup.py.in?revision=475037

and use it in place of dist/setup.py.in and use build_installer.bat to
confirm that it autodetects the APR lib versions okay.

Also, can you send us the mod_python.vcproj file you modified to add
finfoobject.c so we can include it back in mod_python source code.

Thanks.

Graham

Jeff Robbins wrote ..
Nicolas,

I downloaded the stock 2.2.3 binary build.  To get setup.py to link, I
had to edit this:

        if winbuild:
libraries = ['libhttpd', 'libapr-1', 'libaprutil-1', 'ws2_32']

(added the -1 to libapr and libaprutil)

The resultant build produced _psp.pyd and also a mod_python_so.pyd which
I renamed mod_python.so and it ran.

Does this sound right?

- Jeff
----- Original Message ----- From: Nicolas Lehuen
  To: Graham Dumpleton
  Cc: python-dev@httpd.apache.org
  Sent: Sunday, November 12, 2006 21:04
  Subject: Re: mod_python 3.3.0-dev-20061109 tests on Win32


  Indeed, the APACHESRC variable has a slightly misleading name, since
it doesn't need the full blown source installation. When building mod_python
I'm using a stock Win32 Apache 2.0 or 2.2 binary build downloaded from
http://httpd.apache.org/, not a source distribution. It may or may not
work with a source distribution, but I'm positive it does with a binary
one, so Jeff, you should definitely try it this way.

  Regards,
  Nicolas


  2006/11/13, Graham Dumpleton <[EMAIL PROTECTED]>:
    Jeff Robbins wrote ..
    > Graham,
    >
    > These instructions are not sufficient.  The apache environment I
have on
    > windows has include files in <apachesr>/include but also in
> <apachesrc>/srclib/apr/include, <apachesrc>/srclib/apr-iconv/include,
and
    > <apachesrc>/srclib/apr-util/include
    >
    > Setting the APACHESRC environmental per the instructions only finds
the
    > includes in $APACHESRC/include but not the apr files like apr.h in
the
    > error
    > I posted.  In the vcproj file, I had to tell the IDE in some dialog
where
    > to
    > find these include files.  Is there some other environmental or is
there
> some copy phase in the build on Linux that gets all the include files
into
    > $APACHESRC/include?

All this suggests you are setting APACHESRC to where the original source
code
    for Apache resides. Can you see if there is a distinct area where the
include
    files are installed into along with Apache binaries, modules, config
etc. I'm
    not a Windows person, but do you have a \Apache2 directory with an
include
    directory under that. If so, set APACHESRC to \Apache2. If not, then
will have
    to hope Nicolas is reading email at the moment and comment and he is
the
    one who normally builds the Win32 binary releases for us.

    > Where is apr.h on your machine?

    In the single include directory along with ap_*.h header files etc
where Apache
    was installed into.

    Graham

    > ----- Original Message -----
    > From: "Graham Dumpleton" <[EMAIL PROTECTED]>
    > To: < python-dev@httpd.apache.org>
    > Sent: Sunday, November 12, 2006 20:18
    > Subject: Re: mod_python 3.3.0-dev-20061109 tests on Win32
    >
    >
    > > Try follow these instructions:
    > >
> > http://www.modpython.org/pipermail/mod_python/2006-September/022092.html
    > >
    > > If these are correct, they probably should be put in the source
code
    > if
    > > they
    > > aren't already.
    > >
    > > Graham
    > >
    > > Jeff Robbins wrote ..
    > >> re: building on Win32
    > >>
    > >> I tried using setup.py but even once I set APACHESRC it still
couldn't
    > >> find
    > >> the apr* include directories.  I set ext_modules = [PSPModule]
alone
    > and
    > >> it
    > >> built _psp.pyd no problem!
    > >>
    > >>
    > >> C:\work\mod_python-3.3.0-dev-20061109\dist>python setup.py build
    > >> running build
    > >> running build_py
    > >> running build_ext
    > >> building 'mod_python_so' extension
> >> C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe
/c
    > >> /nologo
    > >> /Ox
    > >>  /MD /W3 /GX
> >> /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS -IC:\work\mod_python- 3.3.0-dev > >> -20061109\src\include -IC:\work\httpd-2.2.3\include -IC:\Python24\include
    > >> -IC:\P
> >> ython24\PC /TcC:\work\mod_python-3.3.0-dev-20061109\src\mod_python.c
    > >> /FoC:\work\
    > >> mod_python-3.3.0-dev-20061109\src\mod_python.obj
    > >> mod_python.c
    > >> c:\work\httpd-2.2.3\include\ap_config.h(25) : fatal error C1083:
Cannot
    > >> open
    > >> inc
    > >> lude file: 'apr.h': No such file or directory
    > >> error: command '"C:\Program Files\Microsoft Visual Studio .NET
    > >> 2003\Vc7\bin\cl.e
    > >> xe"' failed with exit status 2
    > >>
    > >>
    > >> ----- Original Message -----
    > >> From: "Graham Dumpleton" <[EMAIL PROTECTED]>
    > >> To: "Jeff Robbins" < [EMAIL PROTECTED]>
    > >> Cc: "python-dev list" <python-dev@httpd.apache.org>
    > >> Sent: Saturday, November 11, 2006 20:18
    > >> Subject: Re: mod_python 3.3.0-dev-20061109 tests on Win32
    > >>
    > >>
    > >> >
    > >> > On 12/11/2006, at 12:31 AM, Jeff Robbins wrote:
    > >> >
    > >> >> 3 problems found on Win32:
    > >> >>
    > >> >>
    > >> >> 1) _psp didn't build and I don't know how to build it
    > >> >
    > >> > How are you trying to build mod_python in the first place? Are
you
    > >> > using
    > >> > dist/build_installer.bat or using VisualStudio project file.
The
    > >> > latter
    > >> > isn't
> >> > really used any longer and isn't tested. We know that it doesn't
list
    > >> the
    > >> > finfoobject.c file for a start.
    > >> >
    > >> >> 2) In the 'Testing PythonImport' test, the path separators
in the
    > two
    > >> >> paths being compared are different (no doubt due to Win32
backslash
    > >> vs
    > >> >> forward slash issues)
    > >> >>
    > >> >> the tests.py code does this:
    > >> >>    directory = os.path.dirname(__file__)
    > >> >>    assert( sys.path.count(directory) == 1)
    > >> >>
    > >> >> os.path.dirname(__file__) is 'C:\\work\\mod_python-3.3.0-
    > >> >> dev-20061109\\test\\htdocs'
    > >> >>
> >> >> yet sys.path has this in it 'C:/work/mod_python-3.3.0-dev-20061109/
    > >> >> test\\\\htdocs'
    > >> >>
    > >> >> so the assert fails since the first string can't be found in
sys.path
    > >> >> (count == 0)
    > >> >
    > >> > If in test/test.py you change:
    > >> >
> >> > c = Container(PythonPath("[r'%s']+sys.path" % DOCUMENT_ROOT),
    > >> >
    > >> > to:
    > >> >
    > >> >         c = Container(PythonPath("[r'%s']+sys.path" %
    > >> > os.path.normpath(DOCUMENT_ROOT)),
    > >> >
    > >> > does it pass?
    > >> >
    > >> >> 3) in test_interpreter_per_directory() the code does this:
    > >> >>        rsp = self.vhost_get("test_interpreter_per_directory",
'/
    > >> >> subdir/foo.py').upper()
    > >> >>
> >> >> interpreter+'SUBDIR/' is 'C:/WORK/MOD_PYTHON-3.3.0-DEV-20061109/
    > >> >> TEST/HTDOCS/SUBDIR/'
    > >> >> rsp is 'C:/WORK/MOD_PYTHON- 3.3.0-DEV-20061109/TEST/HTDOCS/'
    > >> >>
    > >> >> I don't understand the tests.py code but it looks like in the
    > >> >> interpreter() code
    > >> >> def interpreter(req):
    > >> >>    if req.phase == "PythonFixupHandler":
> >> >> if req.filename[-1] != '/' and os.path.isdir(req.filename):
    > >> >>            req.write(req.interpreter )
    > >> >>            return apache.DONE
    > >> >>        return apache.OK
    > >> >>    else:
    > >> >>        req.write(req.interpreter)
    > >> >>        return apache.DONE
    > >> >>
> >> >> perhaps the req.filename 'C:/work/mod_python-3.3.0-dev-20061109/
    > >> >> test/htdocs/subdir' is supposed to pass the os.path.isdir()
    > >> >> test...but
    > >> >> it doesn't.  There is no 'subdir' folder under htdocs so  on
Win32,
> >> >> os.path.isdir() returns False. Maybe this is an os dependency?
    > >> >
    > >> > The 'subdir' directory exists in the tarball. Any chance you
    > >> > accidentally
    > >> > deleted
    > >> > it somehow? Can you in a fresh directory unpack the tarball,
verify
    > >> that
    > >> > the
    > >> > directory exists and then rebuild and retest?
    > >> >
    > >> > Graham
    > >> >
    > >> >
    > >

running build
running build_py
creating build
creating build\lib.win32-2.5
creating build\lib.win32-2.5\mod_python
copying C:\work\mod_python-3.3.0-dev-20061109\lib\python\mod_python\apache.py 
-> build\lib.win32-2.5\mod_python
copying C:\work\mod_python-3.3.0-dev-20061109\lib\python\mod_python\cache.py -> 
build\lib.win32-2.5\mod_python
copying C:\work\mod_python-3.3.0-dev-20061109\lib\python\mod_python\cgihandler.py 
-> build\lib.win32-2.5\mod_python
copying C:\work\mod_python-3.3.0-dev-20061109\lib\python\mod_python\Cookie.py 
-> build\lib.win32-2.5\mod_python
copying C:\work\mod_python-3.3.0-dev-20061109\lib\python\mod_python\importer.py 
-> build\lib.win32-2.5\mod_python
copying C:\work\mod_python-3.3.0-dev-20061109\lib\python\mod_python\psp.py -> 
build\lib.win32-2.5\mod_python
copying C:\work\mod_python-3.3.0-dev-20061109\lib\python\mod_python\publisher.py 
-> build\lib.win32-2.5\mod_python
copying C:\work\mod_python-3.3.0-dev-20061109\lib\python\mod_python\python22.py 
-> build\lib.win32-2.5\mod_python
copying C:\work\mod_python-3.3.0-dev-20061109\lib\python\mod_python\Session.py 
-> build\lib.win32-2.5\mod_python
copying C:\work\mod_python-3.3.0-dev-20061109\lib\python\mod_python\testhandler.py 
-> build\lib.win32-2.5\mod_python
copying C:\work\mod_python-3.3.0-dev-20061109\lib\python\mod_python\util.py -> 
build\lib.win32-2.5\mod_python
copying C:\work\mod_python-3.3.0-dev-20061109\lib\python\mod_python\__init__.py 
-> build\lib.win32-2.5\mod_python
running build_ext
building 'mod_python_so' extension
creating build\temp.win32-2.5
creating build\temp.win32-2.5\Release
creating build\temp.win32-2.5\Release\work
creating build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109
creating build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 
/GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include "-IC:\Program Files\Apache 
Software Foundation\Apache2.2\include" -Ic:\python25\include -Ic:\python25\PC 
/TcC:\work\mod_python-3.3.0-dev-20061109\src\mod_python.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\mod_python.obj
mod_python.c
c:\Python25\include\pyconfig.h(309) : warning C4005: 'PLATFORM' : macro 
redefinition
       c:\Program Files\Apache Software Foundation\Apache2.2\include\os.h(41) : 
see previous definition of 'PLATFORM'
C:\work\mod_python-3.3.0-dev-20061109\src\mod_python.c(429) : warning C4101: 
'mutex_dir' : unreferenced local variable
C:\work\mod_python-3.3.0-dev-20061109\src\mod_python.c(1985) : warning C4244: 
'function' : conversion from 'apr_off_t' to 'apr_size_t', possible loss of data
C:\work\mod_python-3.3.0-dev-20061109\src\mod_python.c(2028) : warning C4101: 
'tmp_buck' : unreferenced local variable
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 
/GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include "-IC:\Program Files\Apache 
Software Foundation\Apache2.2\include" -Ic:\python25\include -Ic:\python25\PC 
/TcC:\work\mod_python-3.3.0-dev-20061109\src\_apachemodule.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\_apachemodule.obj
_apachemodule.c
c:\Python25\include\pyconfig.h(309) : warning C4005: 'PLATFORM' : macro 
redefinition
       c:\Program Files\Apache Software Foundation\Apache2.2\include\os.h(41) : 
see previous definition of 'PLATFORM'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 
/GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include "-IC:\Program Files\Apache 
Software Foundation\Apache2.2\include" -Ic:\python25\include -Ic:\python25\PC 
/TcC:\work\mod_python-3.3.0-dev-20061109\src\connobject.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\connobject.obj
connobject.c
c:\Python25\include\pyconfig.h(309) : warning C4005: 'PLATFORM' : macro 
redefinition
       c:\Program Files\Apache Software Foundation\Apache2.2\include\os.h(41) : 
see previous definition of 'PLATFORM'
C:\work\mod_python-3.3.0-dev-20061109\src\connobject.c(155) : warning C4018: 
'>' : signed/unsigned mismatch
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 
/GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include "-IC:\Program Files\Apache 
Software Foundation\Apache2.2\include" -Ic:\python25\include -Ic:\python25\PC 
/TcC:\work\mod_python-3.3.0-dev-20061109\src\filterobject.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\filterobject.obj
filterobject.c
c:\Python25\include\pyconfig.h(309) : warning C4005: 'PLATFORM' : macro 
redefinition
       c:\Program Files\Apache Software Foundation\Apache2.2\include\os.h(41) : 
see previous definition of 'PLATFORM'
C:\work\mod_python-3.3.0-dev-20061109\src\filterobject.c(234) : warning C4018: 
'>' : signed/unsigned mismatch
C:\work\mod_python-3.3.0-dev-20061109\src\filterobject.c(243) : warning C4018: 
'<' : signed/unsigned mismatch
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 
/GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include "-IC:\Program Files\Apache 
Software Foundation\Apache2.2\include" -Ic:\python25\include -Ic:\python25\PC 
/TcC:\work\mod_python-3.3.0-dev-20061109\src\hlist.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\hlist.obj
hlist.c
c:\Python25\include\pyconfig.h(309) : warning C4005: 'PLATFORM' : macro 
redefinition
       c:\Program Files\Apache Software Foundation\Apache2.2\include\os.h(41) : 
see previous definition of 'PLATFORM'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 
/GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include "-IC:\Program Files\Apache 
Software Foundation\Apache2.2\include" -Ic:\python25\include -Ic:\python25\PC 
/TcC:\work\mod_python-3.3.0-dev-20061109\src\hlistobject.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\hlistobject.obj
hlistobject.c
c:\Python25\include\pyconfig.h(309) : warning C4005: 'PLATFORM' : macro 
redefinition
       c:\Program Files\Apache Software Foundation\Apache2.2\include\os.h(41) : 
see previous definition of 'PLATFORM'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 
/GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include "-IC:\Program Files\Apache 
Software Foundation\Apache2.2\include" -Ic:\python25\include -Ic:\python25\PC 
/TcC:\work\mod_python-3.3.0-dev-20061109\src\requestobject.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\requestobject.obj
requestobject.c
c:\Python25\include\pyconfig.h(309) : warning C4005: 'PLATFORM' : macro 
redefinition
       c:\Program Files\Apache Software Foundation\Apache2.2\include\os.h(41) : 
see previous definition of 'PLATFORM'
C:\work\mod_python-3.3.0-dev-20061109\src\requestobject.c(886) : warning C4244: 
'=' : conversion from 'apr_off_t' to 'long', possible loss of data
C:\work\mod_python-3.3.0-dev-20061109\src\requestobject.c(986) : warning C4244: 
'=' : conversion from 'apr_off_t' to 'long', possible loss of data
C:\work\mod_python-3.3.0-dev-20061109\src\requestobject.c(1434) : warning 
C4244: '=' : conversion from 'apr_off_t' to 'apr_size_t', possible loss of data
C:\work\mod_python-3.3.0-dev-20061109\src\requestobject.c(1609) : warning 
C4244: 'initializing' : conversion from 'apr_off_t' to 'long', possible loss of 
data
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 
/GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include "-IC:\Program Files\Apache 
Software Foundation\Apache2.2\include" -Ic:\python25\include -Ic:\python25\PC 
/TcC:\work\mod_python-3.3.0-dev-20061109\src\serverobject.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\serverobject.obj
serverobject.c
c:\Python25\include\pyconfig.h(309) : warning C4005: 'PLATFORM' : macro 
redefinition
       c:\Program Files\Apache Software Foundation\Apache2.2\include\os.h(41) : 
see previous definition of 'PLATFORM'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 
/GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include "-IC:\Program Files\Apache 
Software Foundation\Apache2.2\include" -Ic:\python25\include -Ic:\python25\PC 
/TcC:\work\mod_python-3.3.0-dev-20061109\src\tableobject.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\tableobject.obj
tableobject.c
c:\Python25\include\pyconfig.h(309) : warning C4005: 'PLATFORM' : macro 
redefinition
       c:\Program Files\Apache Software Foundation\Apache2.2\include\os.h(41) : 
see previous definition of 'PLATFORM'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 
/GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include "-IC:\Program Files\Apache 
Software Foundation\Apache2.2\include" -Ic:\python25\include -Ic:\python25\PC 
/TcC:\work\mod_python-3.3.0-dev-20061109\src\util.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\util.obj
util.c
c:\Python25\include\pyconfig.h(309) : warning C4005: 'PLATFORM' : macro 
redefinition
       c:\Program Files\Apache Software Foundation\Apache2.2\include\os.h(41) : 
see previous definition of 'PLATFORM'
C:\work\mod_python-3.3.0-dev-20061109\src\util.c(122) : warning C4244: 
'function' : conversion from 'apr_ino_t' to 'long', possible loss of data
C:\work\mod_python-3.3.0-dev-20061109\src\util.c(140) : warning C4047: 
'function' : 'long' differs in levels of indirection from 'apr_uid_t'
C:\work\mod_python-3.3.0-dev-20061109\src\util.c(146) : warning C4047: 
'function' : 'long' differs in levels of indirection from 'apr_gid_t'
C:\work\mod_python-3.3.0-dev-20061109\src\util.c(152) : warning C4244: 
'function' : conversion from 'apr_off_t' to 'long', possible loss of data
C:\work\mod_python-3.3.0-dev-20061109\src\util.c(158) : warning C4244: 
'function' : conversion from 'double' to 'long', possible loss of data
C:\work\mod_python-3.3.0-dev-20061109\src\util.c(164) : warning C4244: 
'function' : conversion from 'double' to 'long', possible loss of data
C:\work\mod_python-3.3.0-dev-20061109\src\util.c(170) : warning C4244: 
'function' : conversion from 'double' to 'long', possible loss of data
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 
/GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include "-IC:\Program Files\Apache 
Software Foundation\Apache2.2\include" -Ic:\python25\include -Ic:\python25\PC 
/TcC:\work\mod_python-3.3.0-dev-20061109\src\finfoobject.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\finfoobject.obj
finfoobject.c
c:\Python25\include\pyconfig.h(309) : warning C4005: 'PLATFORM' : macro 
redefinition
       c:\Program Files\Apache Software Foundation\Apache2.2\include\os.h(41) : 
see previous definition of 'PLATFORM'
C:\work\mod_python-3.3.0-dev-20061109\src\finfoobject.c(129) : warning C4047: 
'function' : 'long' differs in levels of indirection from 'apr_uid_t'
C:\work\mod_python-3.3.0-dev-20061109\src\finfoobject.c(137) : warning C4047: 
'function' : 'long' differs in levels of indirection from 'apr_gid_t'
C:\work\mod_python-3.3.0-dev-20061109\src\finfoobject.c(145) : warning C4244: 
'function' : conversion from 'apr_ino_t' to 'long', possible loss of data
C:\work\mod_python-3.3.0-dev-20061109\src\finfoobject.c(173) : warning C4244: 
'function' : conversion from 'apr_off_t' to 'long', possible loss of data
C:\work\mod_python-3.3.0-dev-20061109\src\finfoobject.c(183) : warning C4244: 
'function' : conversion from 'double' to 'long', possible loss of data
C:\work\mod_python-3.3.0-dev-20061109\src\finfoobject.c(191) : warning C4244: 
'function' : conversion from 'double' to 'long', possible loss of data
C:\work\mod_python-3.3.0-dev-20061109\src\finfoobject.c(199) : warning C4244: 
'function' : conversion from 'double' to 'long', possible loss of data
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\rc.exe -DWIN32 -DNDEBUG 
-D_WINDOWS -IC:\work\mod_python-3.3.0-dev-20061109\src\include "-IC:\Program 
Files\Apache Software Foundation\Apache2.2\include" -Ic:\python25\include 
-Ic:\python25\PC 
/fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\Version.res 
C:\work\mod_python-3.3.0-dev-20061109\src\Version.rc
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe /DLL /nologo 
/INCREMENTAL:NO "/LIBPATH:C:\Program Files\Apache Software 
Foundation\Apache2.2\lib" /LIBPATH:c:\python25\libs /LIBPATH:c:\python25\PCBuild 
libhttpd.lib libapr-1.lib libaprutil-1.lib ws2_32.lib 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\mod_python.obj 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\_apachemodule.obj 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\connobject.obj 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\filterobject.obj 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\hlist.obj 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\hlistobject.obj 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\requestobject.obj 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\serverobject.obj 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\tableobject.obj 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\util.obj 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\finfoobject.obj 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\Version.res 
/OUT:build\lib.win32-2.5\mod_python_so.pyd 
/IMPLIB:build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\mod_python_so.lib
  Creating library 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\mod_python_so.lib
 and object 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\mod_python_so.exp
building 'mod_python._psp' extension
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo 
/Ox /MD /W3 /GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include -Ic:\python25\include 
-Ic:\python25\PC /TcC:\work\mod_python-3.3.0-dev-20061109\src\psp_string.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\psp_string.obj
psp_string.c
C:\work\mod_python-3.3.0-dev-20061109\src\psp_string.c(53) : warning C4018: '>' 
: signed/unsigned mismatch
C:\work\mod_python-3.3.0-dev-20061109\src\psp_string.c(72) : warning C4018: '>' 
: signed/unsigned mismatch
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo 
/Ox /MD /W3 /GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include -Ic:\python25\include 
-Ic:\python25\PC /TcC:\work\mod_python-3.3.0-dev-20061109\src\psp_parser.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\psp_parser.obj
psp_parser.c
psp_parser.c(1665) : warning C4273: 'isatty' : inconsistent dll linkage
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo 
/Ox /MD /W3 /GX /DNDEBUG -DWIN32 -DNDEBUG -D_WINDOWS 
-IC:\work\mod_python-3.3.0-dev-20061109\src\include -Ic:\python25\include 
-Ic:\python25\PC /TcC:\work\mod_python-3.3.0-dev-20061109\src\_pspmodule.c 
/Fobuild\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\_pspmodule.obj
_pspmodule.c
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe /DLL 
/nologo /INCREMENTAL:NO /LIBPATH:c:\python25\libs /LIBPATH:c:\python25\PCBuild 
/EXPORT:init_psp 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\psp_string.obj
 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\psp_parser.obj
 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\_pspmodule.obj
 /OUT:build\lib.win32-2.5\mod_python\_psp.pyd 
/IMPLIB:build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\_psp.lib
  Creating library 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\_psp.lib 
and object 
build\temp.win32-2.5\Release\work\mod_python-3.3.0-dev-20061109\src\_psp.exp
running build_scripts
creating build\scripts-2.5
copying win32_postinstall.py -> build\scripts-2.5
#ifndef Mp_MOD_PYTHON_H
#define Mp_MOD_PYTHON_H

/*
* Copyright 2004 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in compliance with the License.  You
* may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.  See the License for the specific language governing
* permissions and limitations under the License.
*
* Originally developed by Gregory Trubetskoy.
*
*
* mod_python.h *
* $Id: mod_python.h 467228 2006-10-24 03:41:54Z grahamd $
*
* See accompanying documentation and source code comments * for details.
*
*/

/*
* NOTE - NOTE - NOTE - NOTE
*
* If you are looking at mod_python.h, it is an auto-generated file on
* UNIX.  This file is kept around for the Win32 platform which
* doesnot use autoconf. Any changes to mod_python.h must also be
* reflected in mod_python.h.in.
*/


/* Apache headers */
#include "httpd.h"
#define CORE_PRIVATE
#include "http_config.h"
#include "http_core.h"
#include "http_main.h"
#include "http_connection.h"
#include "http_protocol.h"
#include "http_request.h"
#include "util_script.h"
#include "util_filter.h"
#include "http_log.h"
#include "apr_strings.h"
#include "apr_lib.h"
#include "apr_hash.h"
#include "apr_fnmatch.h"
#include "scoreboard.h"
#include "ap_mpm.h"
#include "ap_mmn.h"
#include "mod_include.h"
#if !defined(OS2) && !defined(WIN32) && !defined(BEOS) && !defined(NETWARE)
#include "unixd.h"
#endif

#if !AP_MODULE_MAGIC_AT_LEAST(20050127,0)
/* Debian backported ap_regex_t to Apache 2.0 and
* thus made official version checking break. */
#ifndef AP_REG_EXTENDED
typedef regex_t ap_regex_t;
#define AP_REG_EXTENDED REG_EXTENDED
#define AP_REG_ICASE REG_ICASE
#endif
#endif

/* Python headers */
/* this gets rid of some compile warnings */
#if defined(_POSIX_THREADS)
#undef _POSIX_THREADS
#endif
#include "Python.h"
#include "structmember.h"

#if defined(WIN32) && !defined(WITH_THREAD)
#error Python threading must be enabled on Windows
#endif

#if !defined(WIN32)
#include <sys/socket.h>
// BEGIN JSR change
#else
#undef DL_IMPORT
#               define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
// END JSR change
#endif

/* pool given to us in ChildInit. We use it for server.register_cleanup() */
extern apr_pool_t *child_init_pool;

/* Apache module declaration */
extern module AP_MODULE_DECLARE_DATA python_module;

#include "mpversion.h"
#include "util.h"
#include "hlist.h"
#include "hlistobject.h"
#include "tableobject.h"
#include "serverobject.h"
#include "connobject.h"
#include "_apachemodule.h"
#include "requestobject.h"
#include "filterobject.h"
#include "_pspmodule.h"
#include "finfoobject.h"

/** Things specific to mod_python, as an Apache module **/

#define MP_CONFIG_KEY "mod_python_config"
#define VERSION_COMPONENT "mod_python/" MPV_STRING
#define MODULENAME "mod_python.apache"
#define INITFUNC "init"
#define MAIN_INTERPRETER "main_interpreter"
#define FILTER_NAME "MOD_PYTHON"

/* used in python_directive_handler */
#define SILENT 1
#define NOTSILENT 0

/* MAX_LOCKS can now be set as a configure option
* ./configure --with-max-locks=INTEGER
*/
#define MAX_LOCKS 8
/* MUTEX_DIR can be set as a configure option
* ./configure --with-mutex-dir=/path/to/dir
*/
#define MUTEX_DIR "/tmp"
/* python 2.3 no longer defines LONG_LONG, it defines PY_LONG_LONG */
#ifndef LONG_LONG
#define LONG_LONG PY_LONG_LONG
#endif

/* structure to hold interpreter data */
typedef struct {
   PyInterpreterState *istate;
   PyObject *obcallback;
} interpreterdata;

/* global configuration parameters */
typedef struct
{
   apr_global_mutex_t **g_locks;
   int                  nlocks;
   int                  parent_pid;
} py_global_config;

/* structure describing per directory configuration parameters */
typedef struct {
   int           authoritative;
   char         *config_dir;
   apr_table_t  *directives;
   apr_table_t  *options;
   apr_hash_t   *hlists; /* hlists for every phase */
   apr_hash_t   *in_filters;
   apr_hash_t   *out_filters;
   apr_table_t  *imports;  /* for PythonImport */
} py_config;

/* register_cleanup info */
typedef struct
{
   request_rec  *request_rec;
   server_rec   *server_rec;
   PyObject     *handler;
   const char   *interpreter;
   PyObject     *data;
} cleanup_info;

/* request config structure */
typedef struct
{
   requestobject *request_obj;
   apr_hash_t    *dynhls;     /* dynamically registered handlers
                                 for this request */
   apr_hash_t   *in_filters;  /* dynamically registered input filters
                                 for this request */
   apr_hash_t   *out_filters; /* dynamically registered output filters
                                 for this request */

} py_req_config;

/* filter context */
typedef struct
{
   char *name;
   int transparent;
} python_filter_ctx;

/* a structure to hold a handler, used in configuration for filters */
typedef struct
{
   char *handler;
   PyObject *callable;
   char *directory;
   int d_is_fnmatch;
   ap_regex_t *d_regex;
   char *location;
   int l_is_fnmatch;
   ap_regex_t *l_regex;
   hl_entry *parent;
} py_handler;

apr_status_t python_cleanup(void *data);
PyObject* python_interpreter_name(void);
requestobject *python_get_request_object(request_rec *req, const char *phase);

APR_DECLARE_OPTIONAL_FN(PyInterpreterState *, mp_acquire_interpreter, (const 
char *));
// JSR changed void * to void in next line
APR_DECLARE_OPTIONAL_FN(void, mp_release_interpreter, ());
APR_DECLARE_OPTIONAL_FN(PyObject *, mp_get_request_object, (request_rec *));
APR_DECLARE_OPTIONAL_FN(PyObject *, mp_get_server_object, (server_rec *));
APR_DECLARE_OPTIONAL_FN(PyObject *, mp_get_connection_object, (conn_rec *));

#endif /* !Mp_MOD_PYTHON_H */

/*
# makes emacs go into C mode
### Local Variables:
### mode:c
### End:
*/

Reply via email to