crypt.h defines struct crypt_data only if _REENTRANT is defined
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;
if test "$php_cv_crypt_r_style" = "none"; then
AC_TRY_COMPILE([
+#define _REENTRANT 1
#include <crypt.h>
],[
struct crypt_data buffer;
if test "$php_cv_crypt_r_style" = "none"; then
AC_TRY_COMPILE([
+#define _REENTRANT 1
#define _GNU_SOURCE
#include <crypt.h>
],[
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;