Skip to content

Commit 6ca6e9f

Browse files
devnexennikic
authored andcommitted
Fix crypt_r detection under BSD system
For BSD systems, crypt.h does not exist, instead we need to include unistd.h. Closes GH-5971.
1 parent 3485ec4 commit 6ca6e9f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

build/php.m4

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,6 +2217,17 @@ crypt_r("passwd", "hash", &buffer);
22172217
fi
22182218
])
22192219
2220+
if test "$php_cv_crypt_r_style" = "none"; then
2221+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2222+
#include <stdlib.h>
2223+
#include <unistd.h>
2224+
]],[[
2225+
struct crypt_data buffer;
2226+
crypt_r("passwd", "hash", &buffer);
2227+
]])],[php_cv_crypt_r_style=struct_crypt_data],[])
2228+
fi
2229+
])
2230+
22202231
if test "$php_cv_crypt_r_style" = "cryptd"; then
22212232
AC_DEFINE(CRYPT_R_CRYPTD, 1, [Define if crypt_r has uses CRYPTD])
22222233
fi

0 commit comments

Comments
 (0)