Skip to content

Commit

Permalink
Use standard types in fopencookie test
Browse files Browse the repository at this point in the history
Instead of internal __size_t / __off64_t types use ssize_t and off64_t.
This makes it work on musl as well.
  • Loading branch information
nikic committed Aug 5, 2020
1 parent ef773bf commit 4cc4f9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1464,16 +1464,16 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.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};
Expand Down
2 changes: 1 addition & 1 deletion main/streams/cast.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,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);
Expand Down

0 comments on commit 4cc4f9c

Please sign in to comment.