[Zope3-dev] Zope3 vs CVS Python

Guido van Rossum guido@python.org
Tue, 06 Aug 2002 10:28:16 -0400


> That brings me to a slightly different topic that still fits the subject 
> line.  If anyone can help, I'd like to understand why gcc 2.95.3 under 
> Wine doesn't think PyType_GenericNew, PyType_GenericAlloc, 
> _PyObject_GC_Del are constants.  Compiling the Zope3 modules that use 
> these constants in the PyTypeObject struct results in errors like this:
> 
> wrapper.c:228: initializer element is not constant
> wrapper.c:228: (near initialization for `WrapperType.tp_alloc')
> wrapper.c:230: initializer element is not constant
> wrapper.c:230: (near initialization for `WrapperType.tp_free')
> error: command 'gcc' failed with exit status 1

Hm.  This works with GCC on Unix, and also works with MSVC on Windows.
But if you feel that GCC on Windows is an important target, can you
please check in a fix?  It's a fine line, initializing structures with
addresses defined in different files often doesn't seem to work on
Windows.  MSVC has this problem only for the address of external
data, I believe -- over the years we've grown a whole set of ways to
deal with the fact that you can't initialize the ob_type field of a
type struct with &PyType_Type on Windows...

--Guido van Rossum (home page: http://www.python.org/~guido/)