From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 29 Sep 2021 20:47:58 +0000 (-0700) Subject: closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394) X-Git-Tag: v3.9.8~116 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9626ac8b7421aa5fc04a30359521d24f40105141;p=thirdparty%2FPython%2Fcpython.git closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394) Automerge-Triggered-By: GH:benjaminp (cherry picked from commit 196998e220d6ca030e5a1c8ad63fcaed8e049a98) Co-authored-by: Geoffrey Thomas --- diff --git a/Include/Python.h b/Include/Python.h index acee38c41539..6ee52e749283 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -35,19 +35,6 @@ #ifndef MS_WINDOWS #include #endif -#ifdef HAVE_CRYPT_H -#if defined(HAVE_CRYPT_R) && !defined(_GNU_SOURCE) -/* Required for glibc to expose the crypt_r() function prototype. */ -# define _GNU_SOURCE -# define _Py_GNU_SOURCE_FOR_CRYPT -#endif -#include -#ifdef _Py_GNU_SOURCE_FOR_CRYPT -/* Don't leak the _GNU_SOURCE define to other headers. */ -# undef _GNU_SOURCE -# undef _Py_GNU_SOURCE_FOR_CRYPT -#endif -#endif /* For size_t? */ #ifdef HAVE_STDDEF_H diff --git a/Misc/NEWS.d/next/C API/2021-07-27-17-29-12.bpo-44751.4qmbDG.rst b/Misc/NEWS.d/next/C API/2021-07-27-17-29-12.bpo-44751.4qmbDG.rst new file mode 100644 index 000000000000..d7b9f0981966 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2021-07-27-17-29-12.bpo-44751.4qmbDG.rst @@ -0,0 +1 @@ +Remove ``crypt.h`` include from the public ``Python.h`` header. diff --git a/Modules/_cryptmodule.c b/Modules/_cryptmodule.c index a95f55a63c30..72a4f44600d9 100644 --- a/Modules/_cryptmodule.c +++ b/Modules/_cryptmodule.c @@ -4,6 +4,9 @@ #include "Python.h" #include +#ifdef HAVE_CRYPT_H +#include +#endif /* Module crypt */