From 7efac9b6af06fd230f8ac32d3f4843de7624b2a3 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 6 Mar 2005 09:22:02 +0000 Subject: [PATCH] * flower/libc-extension.cc: * flower/include/libc-extension.hh: [Open]BSD fixes for cookie/funopen declarations. --- ChangeLog | 6 ++++++ flower/include/libc-extension.hh | 15 +++++++++++++-- flower/libc-extension.cc | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 04306f3141..e1c0284a75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-03-06 Jan Nieuwenhuizen + + * flower/libc-extension.cc: + * flower/include/libc-extension.hh: [Open]BSD fixes for + cookie/funopen declarations. + 2005-03-06 Han-Wen Nienhuys * buildscripts/gen-emmentaler-scripts.py (outdir): capitalize diff --git a/flower/include/libc-extension.hh b/flower/include/libc-extension.hh index 11ee88cef0..b3da0e54b2 100644 --- a/flower/include/libc-extension.hh +++ b/flower/include/libc-extension.hh @@ -53,6 +53,8 @@ extern "C" { #include #else +#if ! HAVE_FUNOPEN + #define cookie_io_functions_t le_cookie_io_functions_t typedef struct { @@ -62,6 +64,17 @@ extern "C" { int (*close) (void *); } cookie_io_functions_t; +#else + + typedef struct + { + int (*read) (void *, char *, int); + int (*write) (void *, char const *, int); + fpos_t (*seek) (void *, fpos_t, int); + int (*close) (void *); + } cookie_io_functions_t; + +#endif /* ! HAVE_FUNOPEN */ #endif /* ! HAVE_LIBIO_H */ FILE *fopencookie (void *cookie, char const *modes, @@ -87,9 +100,7 @@ extern "C" { #define putc handle_cookie_io_putc #endif /* ALIAS_FILE_TO_FILECOOKIE */ - #endif /* ! HAVE_FUNOPEN */ - #endif /* ! HAVE_FOPENCOOKIE */ #ifdef __cplusplus diff --git a/flower/libc-extension.cc b/flower/libc-extension.cc index a5085047c3..6b11b1560f 100644 --- a/flower/libc-extension.cc +++ b/flower/libc-extension.cc @@ -164,6 +164,7 @@ extern "C" { FILE * fopencookie (void *cookie, char const *mode, cookie_io_functions_t fun) { + (void) mode; return funopen (cookie, fun.read, fun.write, fun.seek, fun.close); } -- 2.39.2