summaryrefslogtreecommitdiffstats
path: root/Include/Python.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/Python.h')
-rw-r--r--Include/Python.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Include/Python.h b/Include/Python.h
index 0511373..54ea321 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -36,7 +36,17 @@
#include <unistd.h>
#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 <crypt.h>
+#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? */