Skip to content

Commit 9626ac8

Browse files
closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394)
Automerge-Triggered-By: GH:benjaminp (cherry picked from commit 196998e) Co-authored-by: Geoffrey Thomas <[email protected]>
1 parent 87ecdb2 commit 9626ac8

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

Include/Python.h

-13
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,6 @@
3535
#ifndef MS_WINDOWS
3636
#include <unistd.h>
3737
#endif
38-
#ifdef HAVE_CRYPT_H
39-
#if defined(HAVE_CRYPT_R) && !defined(_GNU_SOURCE)
40-
/* Required for glibc to expose the crypt_r() function prototype. */
41-
# define _GNU_SOURCE
42-
# define _Py_GNU_SOURCE_FOR_CRYPT
43-
#endif
44-
#include <crypt.h>
45-
#ifdef _Py_GNU_SOURCE_FOR_CRYPT
46-
/* Don't leak the _GNU_SOURCE define to other headers. */
47-
# undef _GNU_SOURCE
48-
# undef _Py_GNU_SOURCE_FOR_CRYPT
49-
#endif
50-
#endif
5138

5239
/* For size_t? */
5340
#ifdef HAVE_STDDEF_H
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove ``crypt.h`` include from the public ``Python.h`` header.

Modules/_cryptmodule.c

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#include "Python.h"
55

66
#include <sys/types.h>
7+
#ifdef HAVE_CRYPT_H
8+
#include <crypt.h>
9+
#endif
710

811
/* Module crypt */
912

0 commit comments

Comments
 (0)