[SciPy-dev] Weave, numpy, external libraries and conflicting typedefs

David M. Cooke cookedm at physics.mcmaster.ca
Fri Jul 7 16:01:48 CDT 2006

On Fri, 7 Jul 2006 14:32:28 -0600
"Fernando Perez" <fperez.net at gmail.com> wrote:

> On 7/7/06, Travis Oliphant <oliphant at ee.byu.edu> wrote:
> > Also, (in latest SVN)  the MAXMIN macros can be avoided using
> >
> > #define PYA_NOMAXMIN
> >
> > before including arrayobject.h
> Mmh, this looks crufty to me: special cases like these look bad in a
> library, and break the 'just works' ideal we all strive for, IMHO.
> Why not have arrayobject.h be fully include-safe with prefixing of all
> of its #defines, leaving a private header for use by numpy's
> internals?
> I really don't like having to remember (or teach) special cases. One
> never seems like too many, until you forget it months later and waste
> an afternoon hunting for a strange bug.
> Just my opinion...

There's really not all that many uses of MAX() and MIN() in numpy. I can
check in a change to rename all those to PyArray_MAX/PyArray_MIN.

As for the others in arrayobject.h:
- a bunch are handled by PY_ARRAY_TYPES_PREFIX
- there are a bunch of MAX_*, MIN_* constants for ints
* also BITSOF_*, SIZEOF_*
* similiarly, why STRBITSOF_*?
- stuff handling long long: LONGLONG_* and ULONGLONG_*
- flag stuff, some for Numeric backwards compatibility
* the thread macros

stuff with a '*' I think should be private or removed.

|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca

More information about the Scipy-dev mailing list