From 172efe6886993bd1144350574b7501690e5fa170 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Tue, 12 Dec 2006 12:06:00 +0000 Subject: [PATCH] missing part of the fix for #39795 crypt.h defines struct crypt_data only if _REENTRANT is defined --- acinclude.m4 | 3 +++ ext/standard/crypt.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 9662f17190..f8884fa6ce 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -2600,6 +2600,7 @@ AC_DEFUN([PHP_CRYPT_R_STYLE], AC_CACHE_CHECK([which data struct is used by crypt_r], php_cv_crypt_r_style,[ php_cv_crypt_r_style=none AC_TRY_COMPILE([ +#define _REENTRANT 1 #include ],[ CRYPTD buffer; @@ -2609,6 +2610,7 @@ php_cv_crypt_r_style=cryptd) if test "$php_cv_crypt_r_style" = "none"; then AC_TRY_COMPILE([ +#define _REENTRANT 1 #include ],[ struct crypt_data buffer; @@ -2619,6 +2621,7 @@ php_cv_crypt_r_style=struct_crypt_data) if test "$php_cv_crypt_r_style" = "none"; then AC_TRY_COMPILE([ +#define _REENTRANT 1 #define _GNU_SOURCE #include ],[ diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index f119ec6e83..b80b7468eb 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -148,7 +148,7 @@ PHP_FUNCTION(crypt) salt[2] = '\0'; #endif } -#ifdef HAVE_CRYPT_R +#if defined(HAVE_CRYPT_R) && defined(_REENTRANT) { #if defined(CRYPT_R_STRUCT_CRYPT_DATA) struct crypt_data buffer; -- 2.40.0