[Python-Dev] pyconfig.h macro usage

Martin v. Loewis martin at v.loewis.de
Wed Jan 7 18:44:20 EST 2004


Skip Montanaro wrote:
> So that got me to thinking (dangerous, I know)...  What about:

I did the same thing when converting to autoconf 2.5x, and zapped
all which I was certain had no use (at that time).


> Turns out there are quite a few macros defined in pyconfig.h that are
> unused:
> 
>     HAVE_DUP2                       SIZEOF_FLOAT
>     HAVE_GETPID                     SIZEOF_UINTPTR_T
>     HAVE_LIBDL                      SIZEOF_WCHAR_T
>     HAVE_LIBDLD                     SYS_SELECT_WITH_SYS_TIME
>     HAVE_LIBIEEE                    TM_IN_SYS_TIME
>     HAVE_LIBRESOLV                  WITH_DL_DLD
>     HAVE_PTHREAD_INIT               WITH_DYLD
>     HAVE_STDARG_H                   WITH_LIBINTL
>     HAVE_STRDUP                     _FILE_OFFSET_BITS
>     HAVE_STRPTIME                   _LARGEFILE_SOURCE
>     HAVE_ST_BLOCKS                  _MINIX
>     HAVE_SYS_SOCKET_H               _NETBSD_SOURCE
>     HAVE_TERMIOS_H                  _OSF_SOURCE
>     HAVE_TIMEGM                     _POSIX_1_SOURCE
>     HAVE_TM_ZONE                    _POSIX_C_SOURCE
>     HAVE_TRUNCATE                   _POSIX_SOURCE
>     HAVE_UCS4_TCL                   _REENTRANT
>     RETSIGTYPE                      __BSD_VISIBLE
>     SIZEOF_DOUBLE                   __EXTENSIONS__
> 
> Any votes for getting rid of them?

__EXTENSIONS__, *_SOURCE, _REENTRANT, _FILE_OFFSET_BITS are all used
in system headers - so they need to be defined on the systems where
they need to be defined...

HAVE_UCS_TCL should probably be used.

A number of the macros are not used because they are associated
with replacement implementations, such as dup2 (all AC_REPLACE_FUNCS
I think). We (probably) cannot remove the test whether a replacement
function must be defined; that defines the macro as a side effect.

_MINIX can be removed as part of the PEP 11 activities; if you remove
that, please implement all scheduled removals.

The other ones would need a more detailed investigation.

Regards,
Martin




More information about the Python-Dev mailing list