com php-src: Fixed bug #63186 (compile failure on netbsd): NEWS main/streams/cast.c
| From: | Matteo Beccati | Date: | Fri, 14 Jun 2013 14:51:54 +0000 |
| Subject: | com php-src: Fixed bug #63186 (compile failure on netbsd): NEWS main/streams/cast.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-72377@lists.php.net to get a copy of this message | ||
Commit: 6238dd6f3257bed9efe60a39978376862668e71c
Author: Matteo Beccati <mbeccati@php.net> Fri, 14 Jun 2013 16:51:54 +0200
Parents: cd1b44c4b6b67e77d8704a2a24e7c676f835a76d
Branches: PHP-5.3 PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6238dd6f3257bed9efe60a39978376862668e71c
Log:
Fixed bug #63186 (compile failure on netbsd)
Bugs:
https://bugs.php.net/63186
Changed paths:
M NEWS
M main/streams/cast.c
Diff:
diff --git a/NEWS b/NEWS
index 3c5b346..a0f9e2b 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ PHP NEWS
. Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence)
. Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence)
. Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol)
+ . Fixed bug #63186 (compile failure on netbsd). (Matteo)
- DateTime:
. Fixed bug #53437 (Crash when using unserialized DatePeriod instance).
diff --git a/main/streams/cast.c b/main/streams/cast.c
index 4063930..6f79a24 100644
--- a/main/streams/cast.c
+++ b/main/streams/cast.c
@@ -31,10 +31,18 @@
/* Under BSD, emulate fopencookie using funopen */
#if defined(HAVE_FUNOPEN) && !defined(HAVE_FOPENCOOKIE)
+
+/* NetBSD 6.0+ uses off_t instead of fpos_t in funopen */
+# if defined(__NetBSD__) && (__NetBSD_Version__ > 600000000)
+# define PHP_FPOS_T off_t
+# else
+# define PHP_FPOS_T fpos_t
+# endif
+
typedef struct {
int (*reader)(void *, char *, int);
int (*writer)(void *, const char *, int);
- fpos_t (*seeker)(void *, fpos_t, int);
+ PHP_FPOS_T (*seeker)(void *, PHP_FPOS_T, int);
int (*closer)(void *);
} COOKIE_IO_FUNCTIONS_T;
@@ -68,11 +76,11 @@ static int stream_cookie_writer(void *cookie, const char *buffer, int size)
return php_stream_write((php_stream *)cookie, (char *)buffer, size);
}
-static fpos_t stream_cookie_seeker(void *cookie, off_t position, int whence)
+static PHP_FPOS_T stream_cookie_seeker(void *cookie, off_t position, int whence)
{
TSRMLS_FETCH();
- return (fpos_t)php_stream_seek((php_stream *)cookie, position, whence);
+ return (PHP_FPOS_T)php_stream_seek((php_stream *)cookie, position, whence);
}
static int stream_cookie_closer(void *cookie)