|
Gregory (Grisha) Trubetskoy
grisha at modpython.org
Tue Jan 7 00:21:15 EST 2003
Microsoft C compiler doesn't support "long long", this has been fixed in
the latest CVS code. Make the functin look like this, and it will work
OK:
static PyObject *getreq_recmbr_off(requestobject *self, void *name)
{
PyMemberDef *md = find_memberdef(request_rec_mbrs, name);
char *addr = (char *)self->request_rec + md->offset;
if (sizeof(apr_off_t) == sizeof(LONG_LONG)) {
LONG_LONG l = *(LONG_LONG*)addr;
return PyLong_FromLongLong(l);
}
else {
/* assume it's long */
long l = *(long*)addr;
return PyLong_FromLong(l);
}
}
On Mon, 6 Jan 2003, Victor Medina wrote:
> Hi guys!
>
> I am still having problems with mod_python in windows. Hope not be
> bothering too much, but I really want to have mod_python for Apache 2.
> Please understand that compiling it myself is a must.
>
> Ok, so this is what is happening, I am receiving to kinds of problems
>
> PROBLEM #1
> F:\IkiruxNXT-Source\mod_python-3.0.1\src\requestobject.c(1017) : error
> C2632: 'long' followed by 'long' is illegal
> F:\IkiruxNXT-Source\mod_python-3.0.1\src\requestobject.c(1018) : error
> C2632: 'long' followed by 'long' is illegal
> F:\IkiruxNXT-Source\mod_python-3.0.1\src\requestobject.c(1018) : error
> C2632: 'long' followed by 'long' is illegal
>
> The problem seems pretty obvious there is an illegal long long declaration,
> but as far as I know I can use long long's in Win32, at least with the
> Borland Builder compiler, this is the code fragment:
>
> static PyObject *getreq_recmbr_off(requestobject *self, void *name)
> {
> PyMemberDef *md = find_memberdef(request_rec_mbrs, name);
> char *addr = (char *)self->request_rec + md->offset;
> if (sizeof(apr_off_t) == sizeof(long long)) { <---- HERE!!!
> long long l = *(long long*)addr; <---- HERE!!!
> return PyLong_FromLongLong(l);
> }
> else {
> /* assume it's long */
> long l = *(long*)addr;
> return PyLong_FromLong(l);
> }
> }
>
> PROBLEM #2
>
> I am receiving several link errors(well ok, not errors, just plain
> warnings, I am concerned about the quantity of items), about inconsistent
> linkage: inconsistent dll linkage. dllexport assumed.
>
> I am attaching the complete output log, hope not be abusing or breaking any
> rules inside the list.
>
> I am using Windows 2000 SP3, Visual Studio 6 SP5, Python 2.2.2 (custom
> built, not Python.org release, not Activestate's release) and Apache 2.0.43
> (same here, custom built). The include, lib, libs directory are in the
> VC++ Path, thou not includes as part of the project.
>
> Thanxs for your time an cooperation, I would really a appreciate any
> comments or hints
>
> Victor Medina
> UNITEC
> vmedina98 at unitec.edu.ve
> msn: victor_medina at hotmail.com
|