Skip to content

Commit 196998e

Browse files
authored
closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394)
Automerge-Triggered-By: GH:benjaminp
1 parent ecc3c8e commit 196998e

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

Include/Python.h

Lines changed: 0 additions & 13 deletions
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
Lines changed: 1 addition & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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)