@@ -1137,8 +1137,8 @@ dnl PHP_DOES_PWRITE_WORK
11371137dnl
11381138dnl Internal.
11391139dnl
1140- AC_DEFUN ( [ PHP_DOES_PWRITE_WORK] ,[
1141- AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [
1140+ AC_DEFUN ( [ PHP_DOES_PWRITE_WORK] , [
1141+ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [
11421142#include <sys/types.h>
11431143#include <sys/stat.h>
11441144#include <fcntl.h>
@@ -1155,23 +1155,20 @@ $1
11551155 if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) return 1;
11561156 return 0;
11571157 }
1158- ] ) ] ,[
1159- ac_cv_pwrite=yes
1160- ] ,[
1161- ac_cv_pwrite=no
1162- ] ,[
1163- ac_cv_pwrite=no
1164- ] )
1158+ ] ) ] ,
1159+ [ php_cv_func_pwrite=yes] ,
1160+ [ php_cv_func_pwrite=no] ,
1161+ [ php_cv_func_pwrite=no] )
11651162] )
11661163
11671164dnl
11681165dnl PHP_DOES_PREAD_WORK
11691166dnl
11701167dnl Internal.
11711168dnl
1172- AC_DEFUN ( [ PHP_DOES_PREAD_WORK] ,[
1173- echo test > conftest_pread
1174- AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
1169+ AC_DEFUN ( [ PHP_DOES_PREAD_WORK] , [
1170+ echo test > conftest_pread
1171+ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
11751172#include <sys/types.h>
11761173#include <sys/stat.h>
11771174#include <fcntl.h>
@@ -1188,61 +1185,52 @@ $1
11881185 if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) return 1;
11891186 return 0;
11901187 }
1191- ] ] ) ] ,[
1192- ac_cv_pread=yes
1193- ] ,[
1194- ac_cv_pread=no
1195- ] ,[
1196- ac_cv_pread=no
1197- ] )
1188+ ] ] ) ] ,
1189+ [ php_cv_func_pread=yes] ,
1190+ [ php_cv_func_pread=no] ,
1191+ [ php_cv_func_pread=no] )
11981192] )
11991193
12001194dnl
12011195dnl PHP_PWRITE_TEST
12021196dnl
1203- AC_DEFUN ( [ PHP_PWRITE_TEST] ,[
1204- AC_CACHE_CHECK ( whether pwrite works ,ac_cv_pwrite ,[
1205- PHP_DOES_PWRITE_WORK
1206- if test "$ac_cv_pwrite" = "no"; then
1207- PHP_DOES_PWRITE_WORK([ ssize_t pwrite(int, void *, size_t, off64_t);] )
1208- if test "$ac_cv_pwrite" = "yes"; then
1209- ac_cv_pwrite=64
1210- fi
1211- fi
1197+ AC_DEFUN ( [ PHP_PWRITE_TEST] , [
1198+ AC_CACHE_CHECK ( [ whether pwrite works] , [ php_cv_func_pwrite] , [
1199+ PHP_DOES_PWRITE_WORK
1200+ AS_VAR_IF ( [ php_cv_func_pwrite] , [ no] , [
1201+ PHP_DOES_PWRITE_WORK([ ssize_t pwrite(int, void *, size_t, off64_t);] )
1202+ AS_VAR_IF ( [ php_cv_func_pwrite] , [ yes] , [ php_cv_func_pwrite=64] )
12121203 ] )
1204+ ] )
12131205
1214- if test "$ac_cv_pwrite" != "no"; then
1215- AC_DEFINE ( [ HAVE_PWRITE] , [ 1] ,
1216- [ Define to 1 if you have the 'pwrite' function.] )
1217- if test "$ac_cv_pwrite" = "64"; then
1218- AC_DEFINE ( [ PHP_PWRITE_64] , [ 1] ,
1219- [ Define to 1 if 'pwrite' declaration with 'off64_t' is missing.] )
1220- fi
1221- fi
1206+ AS_VAR_IF ( [ php_cv_func_pwrite] , [ no] ,, [
1207+ AC_DEFINE ( [ HAVE_PWRITE] , [ 1] ,
1208+ [ Define to 1 if you have the 'pwrite' function.] )
1209+ AS_VAR_IF ( [ php_cv_func_pwrite] , [ 64] ,
1210+ [ AC_DEFINE ( [ PHP_PWRITE_64] , [ 1] ,
1211+ [ Define to 1 if 'pwrite' declaration with 'off64_t' is missing.] ) ] )
1212+ ] )
12221213] )
12231214
12241215dnl
12251216dnl PHP_PREAD_TEST
12261217dnl
1227- AC_DEFUN ( [ PHP_PREAD_TEST] ,[
1228- AC_CACHE_CHECK ( whether pread works ,ac_cv_pread ,[
1229- PHP_DOES_PREAD_WORK
1230- if test "$ac_cv_pread" = "no"; then
1231- PHP_DOES_PREAD_WORK([ ssize_t pread(int, void *, size_t, off64_t);] )
1232- if test "$ac_cv_pread" = "yes"; then
1233- ac_cv_pread=64
1234- fi
1235- fi
1218+ AC_DEFUN ( [ PHP_PREAD_TEST] , [
1219+ AC_CACHE_CHECK ( [ whether pread works] , [ php_cv_func_pread] , [
1220+ PHP_DOES_PREAD_WORK
1221+ AS_VAR_IF ( [ php_cv_func_pread] , [ no] , [
1222+ PHP_DOES_PREAD_WORK([ ssize_t pread(int, void *, size_t, off64_t);] )
1223+ AS_VAR_IF ( [ php_cv_func_pread] , [ yes] , [ php_cv_func_pread=64] )
12361224 ] )
1225+ ] )
12371226
1238- if test "$ac_cv_pread" != "no"; then
1239- AC_DEFINE ( [ HAVE_PREAD] , [ 1] ,
1240- [ Define to 1 if you have the 'pread' function.] )
1241- if test "$ac_cv_pread" = "64"; then
1242- AC_DEFINE ( [ PHP_PREAD_64] , [ 1] ,
1243- [ Define to 1 if 'pread' declaration with 'off64_t' is missing.] )
1244- fi
1245- fi
1227+ AS_VAR_IF ( [ php_cv_func_pread] , [ no] ,, [
1228+ AC_DEFINE ( [ HAVE_PREAD] , [ 1] ,
1229+ [ Define to 1 if you have the 'pread' function.] )
1230+ AS_VAR_IF ( [ php_cv_func_pread] , [ 64] ,
1231+ [ AC_DEFINE ( [ PHP_PREAD_64] , [ 1] ,
1232+ [ Define to 1 if 'pread' declaration with 'off64_t' is missing.] ) ] )
1233+ ] )
12461234] )
12471235
12481236dnl
0 commit comments