@@ -1137,8 +1137,8 @@ dnl PHP_DOES_PWRITE_WORK
1137
1137
dnl
1138
1138
dnl Internal.
1139
1139
dnl
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 ( [
1142
1142
#include <sys/types.h>
1143
1143
#include <sys/stat.h>
1144
1144
#include <fcntl.h>
@@ -1155,23 +1155,20 @@ $1
1155
1155
if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) return 1;
1156
1156
return 0;
1157
1157
}
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] )
1165
1162
] )
1166
1163
1167
1164
dnl
1168
1165
dnl PHP_DOES_PREAD_WORK
1169
1166
dnl
1170
1167
dnl Internal.
1171
1168
dnl
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 ( [ [
1175
1172
#include <sys/types.h>
1176
1173
#include <sys/stat.h>
1177
1174
#include <fcntl.h>
@@ -1188,61 +1185,52 @@ $1
1188
1185
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) return 1;
1189
1186
return 0;
1190
1187
}
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] )
1198
1192
] )
1199
1193
1200
1194
dnl
1201
1195
dnl PHP_PWRITE_TEST
1202
1196
dnl
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] )
1212
1203
] )
1204
+ ] )
1213
1205
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
+ ] )
1222
1213
] )
1223
1214
1224
1215
dnl
1225
1216
dnl PHP_PREAD_TEST
1226
1217
dnl
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] )
1236
1224
] )
1225
+ ] )
1237
1226
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
+ ] )
1246
1234
] )
1247
1235
1248
1236
dnl
0 commit comments