cvs: php4 /ext/zlib config.m4 zlib.c

From: Date: Mon, 20 Nov 2000 21:36:39 +0000
Subject: cvs: php4 /ext/zlib config.m4 zlib.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-2707@lists.php.net to get a copy of this message
hholzgra Mon Nov 20 13:36:39 2000 EDT Modified files: /php4/ext/zlib config.m4 zlib.c Log: fixed a compile problem with glibc<=2.1.1 (#7327, #7892) # zlib.c still produces a warning, perhaps i should move # the fopen wrapper to a seperate file to get things right # but i think i will wait for the autoconf book to arrive Index: php4/ext/zlib/config.m4 diff -u php4/ext/zlib/config.m4:1.8 php4/ext/zlib/config.m4:1.9 --- php4/ext/zlib/config.m4:1.8 Wed Oct 11 15:40:22 2000 +++ php4/ext/zlib/config.m4 Mon Nov 20 13:36:38 2000 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.8 2000/10/11 22:40:22 hholzgra Exp $ +dnl $Id: config.m4,v 1.9 2000/11/20 21:36:38 hholzgra Exp $ @@ -42,5 +42,43 @@ AC_ADD_INCLUDE($ZLIB_INCDIR) - AC_CHECK_FUNC(fopencookie, [AC_DEFINE(HAVE_FOPENCOOKIE,1,[ ])]) + dnl check for fopencookie() from glibc + AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ]) + + if test "$have_glibc_fopencookie" = "yes" ; then + dnl this comes in two flavors: + dnl newer glibcs (since 2.1.2 ? ) + dnl have a type called cookie_io_functions_t + AC_TRY_COMPILE([ #define _GNU_SOURCE + #include <stdio.h> + ], + [ cookie_io_functions_t cookie; ], + [ have_cookie_io_functions_t=yes ], + [ ] ) + + if test "$have_cookie_io_functions_t" = "yes" ; then + cookie_io_functions_t=cookie_io_functions_t + have_fopen_cookie=yes + else + dnl older glibc versions (up to 2.1.2 ?) + dnl call it _IO_cookie_io_functions_t + AC_TRY_COMPILE([ #define _GNU_SOURCE + #include <stdio.h> + ], + [ _IO_cookie_io_functions_t cookie; ], + [ have_IO_cookie_io_functions_t=yes ], + [] ) + if test "$have_cookie_io_functions_t" = "yes" ; then + cookie_io_functions_t=_IO_cookie_io_functions_t + have_fopen_cookie=yes + fi + fi + + if test "$have_fopen_cookie" = "yes" ; then + AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ]) + AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ]) + fi + + fi + fi Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.66 php4/ext/zlib/zlib.c:1.67 --- php4/ext/zlib/zlib.c:1.66 Mon Nov 13 11:05:25 2000 +++ php4/ext/zlib/zlib.c Mon Nov 20 13:36:38 2000 @@ -16,7 +16,7 @@ | Stefan Röhrich <sr@linux.de> | +----------------------------------------------------------------------+ */ -/* $Id: zlib.c,v 1.66 2000/11/13 19:05:25 zeev Exp $ */ +/* $Id: zlib.c,v 1.67 2000/11/20 21:36:38 hholzgra Exp $ */ #define IS_EXT_MODULE #ifndef PHP_WIN32 @@ -967,7 +967,8 @@ } -static cookie_io_functions_t gz_cookie_functions = + +static COOKIE_IO_FUNCTIONS_T gz_cookie_functions = { gz_reader , gz_writer , gz_seeker

« previous php.cvs (#2707) next »