[issue20768] pyconfig.h #defines macros in global namespace
New submission from Felipe Sateler: I reported the following in the debian bug tracker[1], and it was requested that I report it here. pyconfig.h has definitions like the following: #define HAVE_DIRENT_H 1 #define HAVE_DLFCN_H 1 These are the general form feature test macros take in practically any software project. This means that when building a python module these feature macros conflict. In the best scenario, you get a redefinition warning. In the worst scenario, the build breaks because of inconsistent #defines between the module and pyconfig.h. Please either don't include pycongfig.h from Python.h, or appropiately namespace the test macros (PYTHON_HAVE_* or something like that). [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=738726 -- components: Installation messages: 212178 nosy: fsateler priority: normal severity: normal status: open title: pyconfig.h #defines macros in global namespace versions: Python 2.7, Python 3.4 ___ Python tracker <http://bugs.python.org/issue20768> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20768] pyconfig.h #defines macros in global namespace
Felipe Sateler added the comment: I'm sorry but I definitely don't have time or knowledge about python to propose a patch (simply removing pyconfig.h clearly doesn't work). As to the question, please clarify. I have a python module, which includes Python.h, which includes pyconfig.h. I don't include Python.h everywhere. My build system does use several HAVE_* macros. It seems as if no breakage has occurred, but this is not guaranteed. And I shouldn't need to tiptoe around other libraries feature test macros, especially when they infringe on the global namespace. -- Saludos, Felipe Sateler -- ___ Python tracker <http://bugs.python.org/issue20768> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com