[Numpy-tickets] [NumPy] #593: Avoiding polluting public namespace in numpy headers

NumPy numpy-tickets@scipy....
Wed Oct 17 23:05:06 CDT 2007

#593: Avoiding polluting public namespace in numpy headers
 Reporter:  cdavid       |       Owner:  somebody
     Type:  enhancement  |      Status:  new     
 Priority:  normal       |   Milestone:          
Component:  Other        |     Version:  none    
 Severity:  normal       |    Keywords:          
 This patch splits the config.h header into two distinct files:
  - one numpyconfig.h, which can be used in public headers
  - one config.h, which can NOT be used in public headers (but can be
 included in c files).

 All symbols in numpyconfig.h are NPY_ prepended: this avoids polluting the
 C namespace with symbols such as SIZEOF_* which are often used (most
 projects using autotools will define those too, for example). This makes
 the numpy headers a bit cleaner, a bit easier to integrate in a autotools-
 based project, and is more standard (now, the config.h and numpyconfig.h
 follow more stricty autoheader convention). This does not change in any
 way the C API, or the behaviour in numpy (it is a bug otherwise).

 Within all the symbols declared in config.h, here is the list of the
 symbols which are part of the numpy API (e.g. which should stay public):


 All other are kept private (not visible from numpy headers):


 For SIZEOF_ symbols, I prepended them by NPY_ in numpyconfig.h (this was
 already the case for most of them, though: I just sanitize the header so
 that only the prepended symbols are used).

 To make the review easier, I implemented this enhancement in a branch

Ticket URL: <http://scipy.org/scipy/numpy/ticket/593>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.

More information about the Numpy-tickets mailing list