diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-08-04 15:54:31 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-08-05 09:45:51 +0200 |
commit | b0d139456aad9921d30ba8dfd32fc6cac79dedf9 (patch) | |
tree | 68c86c3abfeb9fc937996c994efa4c432cc67068 | |
parent | ed13fee971932bfdb7730ff05b0f13495731fcb1 (diff) | |
download | php-git-b0d139456aad9921d30ba8dfd32fc6cac79dedf9.tar.gz |
Use standard types in fopencookie test
Instead of internal __size_t / __off64_t types use ssize_t and off64_t.
This makes it work on musl as well.
-rw-r--r-- | build/php.m4 | 8 | ||||
-rw-r--r-- | main/streams/cast.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/build/php.m4 b/build/php.m4 index b7402ff866..6692298267 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -1445,16 +1445,16 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <stdlib.h> struct cookiedata { - __off64_t pos; + off64_t pos; }; -__ssize_t reader(void *cookie, char *buffer, size_t size) +ssize_t reader(void *cookie, char *buffer, size_t size) { return size; } -__ssize_t writer(void *cookie, const char *buffer, size_t size) +ssize_t writer(void *cookie, const char *buffer, size_t size) { return size; } int closer(void *cookie) { return 0; } -int seeker(void *cookie, __off64_t *position, int whence) +int seeker(void *cookie, off64_t *position, int whence) { ((struct cookiedata*)cookie)->pos = *position; return 0; } cookie_io_functions_t funcs = {reader, writer, seeker, closer}; diff --git a/main/streams/cast.c b/main/streams/cast.c index 76d4aa2263..9e689e9d6c 100644 --- a/main/streams/cast.c +++ b/main/streams/cast.c @@ -101,7 +101,7 @@ static ssize_t stream_cookie_writer(void *cookie, const char *buffer, size_t siz } # ifdef COOKIE_SEEKER_USES_OFF64_T -static int stream_cookie_seeker(void *cookie, __off64_t *position, int whence) +static int stream_cookie_seeker(void *cookie, off64_t *position, int whence) { *position = php_stream_seek((php_stream *)cookie, (zend_off_t)*position, whence); |