]> granicus.if.org Git - php/commitdiff
missing part of the fix for #39795
authorAntony Dovgal <tony2001@php.net>
Tue, 12 Dec 2006 12:06:00 +0000 (12:06 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 12 Dec 2006 12:06:00 +0000 (12:06 +0000)
crypt.h defines struct crypt_data only if _REENTRANT is defined

acinclude.m4
ext/standard/crypt.c

index 9662f17190e85c34dfcb00bbe6a095515ae71e89..f8884fa6cee24394aaab57b92dc5da0be958929d 100644 (file)
@@ -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 <crypt.h>
 ],[
 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 <crypt.h>
 ],[
 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 <crypt.h>
 ],[
index f119ec6e8373e06382637f21afe8beca2c195cda..b80b7468eb20a35cb94b325be31b017cf0ea6530 100644 (file)
@@ -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;