| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
The HAVE_ICONV macro is new in Python 3.16. |
Sorry, something went wrong.
There was a problem hiding this comment.
I do not mind, but does it make difference if most of configure macros are HAVE_* and this is standard?
Sorry, something went wrong.
Before we fix things, we should stop making them worse.
Which standard is that? |
Sorry, something went wrong.
|
I do not know if this is a formal standard, but many projects use HAVE_*. |
Sorry, something went wrong.
It's fine to use HAVE_xxx macros to build a project. What bothers me is that Python exposes these macros in its public C API. It's rare that a project exposes its HAVE_xxx macros in public header files. Example of a search on my Fedora 44 which has 6,130 header files in /usr/include: $ find -name "*.h"|wc -l 6130 $ grep -l 'define HAVE_' -R /usr/include/|grep -v /python3|grep -v /pypy3 /usr/include/ncurses/etip.h /usr/include/ncursesw/etip.h /usr/include/etip.h /usr/include/expat_config.h /usr/include/freetype2/freetype/config/ftconfig-64.h /usr/include/tcl-private/unix/tclUnixPort.h All macros: Detailsvstinner@vstinner-thinkpadp1gen3$ grep 'define HAVE_' -R /usr/include/|grep -v /python3|grep -v /pypy3 /usr/include/ncurses/etip.h:#define HAVE_BUILTIN_H 0 /usr/include/ncurses/etip.h:#define HAVE_EXCEPTION 1 /usr/include/ncurses/etip.h:#define HAVE_GXX_BUILTIN_H 0 /usr/include/ncurses/etip.h:#define HAVE_GPP_BUILTIN_H 0 /usr/include/ncurses/etip.h:#define HAVE_IOSTREAM 1 /usr/include/ncurses/etip.h:#define HAVE_NEW 1 /usr/include/ncurses/etip.h:#define HAVE_TYPEINFO 1 /usr/include/ncurses/etip.h:#define HAVE_VALUES_H 0 /usr/include/ncursesw/etip.h:#define HAVE_BUILTIN_H 0 /usr/include/ncursesw/etip.h:#define HAVE_EXCEPTION 1 /usr/include/ncursesw/etip.h:#define HAVE_GXX_BUILTIN_H 0 /usr/include/ncursesw/etip.h:#define HAVE_GPP_BUILTIN_H 0 /usr/include/ncursesw/etip.h:#define HAVE_IOSTREAM 1 /usr/include/ncursesw/etip.h:#define HAVE_NEW 1 /usr/include/ncursesw/etip.h:#define HAVE_TYPEINFO 1 /usr/include/ncursesw/etip.h:#define HAVE_VALUES_H 0 /usr/include/etip.h:#define HAVE_BUILTIN_H 0 /usr/include/etip.h:#define HAVE_EXCEPTION 1 /usr/include/etip.h:#define HAVE_GXX_BUILTIN_H 0 /usr/include/etip.h:#define HAVE_GPP_BUILTIN_H 0 /usr/include/etip.h:#define HAVE_IOSTREAM 1 /usr/include/etip.h:#define HAVE_NEW 1 /usr/include/etip.h:#define HAVE_TYPEINFO 1 /usr/include/etip.h:#define HAVE_VALUES_H 0 /usr/include/expat_config.h:#define HAVE_ARC4RANDOM 1 /usr/include/expat_config.h:#define HAVE_ARC4RANDOM_BUF 1 /usr/include/expat_config.h:#define HAVE_CXX11 1 /usr/include/expat_config.h:#define HAVE_DLFCN_H 1 /usr/include/expat_config.h:#define HAVE_FCNTL_H 1 /usr/include/expat_config.h:#define HAVE_GETENTROPY 1 /usr/include/expat_config.h:#define HAVE_GETPAGESIZE 1 /usr/include/expat_config.h:#define HAVE_GETRANDOM 1 /usr/include/expat_config.h:#define HAVE_INTTYPES_H 1 /usr/include/expat_config.h:#define HAVE_MMAP 1 /usr/include/expat_config.h:#define HAVE_STDINT_H 1 /usr/include/expat_config.h:#define HAVE_STDIO_H 1 /usr/include/expat_config.h:#define HAVE_STDLIB_H 1 /usr/include/expat_config.h:#define HAVE_STRINGS_H 1 /usr/include/expat_config.h:#define HAVE_STRING_H 1 /usr/include/expat_config.h:#define HAVE_SYSCALL_GETRANDOM 1 /usr/include/expat_config.h:#define HAVE_SYS_PARAM_H 1 /usr/include/expat_config.h:#define HAVE_SYS_STAT_H 1 /usr/include/expat_config.h:#define HAVE_SYS_TYPES_H 1 /usr/include/expat_config.h:#define HAVE_UNISTD_H 1 /usr/include/freetype2/freetype/config/ftconfig-64.h:#define HAVE_UNISTD_H 1 /usr/include/freetype2/freetype/config/ftconfig-64.h:#define HAVE_FCNTL_H 1 /usr/include/tcl-private/unix/tclUnixPort.h:# define HAVE_PUTENV_THAT_COPIES 1 Projects built with <Python.h> should implement their own function and header checks, not rely on HAVE_xxx macros. For example, Python can built on a machine and installed on a different machine where HAVE_xxx macros are outdated. |
Sorry, something went wrong.
|
Then the problem is not in having HAVE_* names, but in exposing them in Python.h. What other libraries do to avoid this? |
Sorry, something went wrong.
It seems like they do no include the "config.h" file in their public C API. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.