com php-src: Use standard types in fopencookie test: build/php.m4 main/streams/cast.c
| From: | Nikita Popov | Date: | Wed, 05 Aug 2020 08:39:37 +0000 |
| Subject: | com php-src: Use standard types in fopencookie test: build/php.m4 main/streams/cast.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112568@lists.php.net to get a copy of this message | ||
Commit: 4cc4f9c00a4c43811074286494a621d4c9252613
Author: Nikita Popov <nikita.ppv@gmail.com> Tue, 4 Aug 2020 15:54:31 +0200
Parents: ef773bf4d5cbd96a6f5c904b2feec6c9fe598589
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4cc4f9c00a4c43811074286494a621d4c9252613
Log:
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.
Changed paths:
M build/php.m4
M main/streams/cast.c
Diff:
diff --git a/build/php.m4 b/build/php.m4
index e5b85b24c4..0205d01c3b 100644
--- a/build/php.m4
+++ b/build/php.m4
@@ -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};
diff --git a/main/streams/cast.c b/main/streams/cast.c
index 262ec5e38f..73421a7588 100644
--- a/main/streams/cast.c
+++ b/main/streams/cast.c
@@ -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);