$NetBSD: patch-ak,v 1.1 2010/12/27 05:32:49 obache Exp $ * On DragonFly, FILE is hidden, only allowed to modify in __FILE_public. --- src/formats.c.orig 2010-01-02 00:07:28.000000000 +0000 +++ src/formats.c @@ -397,8 +397,14 @@ static void UNUSED rewind_pipe(FILE * fp /* _FSTDIO is for Torek stdio (i.e. most BSD-derived libc's) * In theory, we no longer need to check _NEWLIB_VERSION or __APPLE__ */ #if defined _FSTDIO || defined _NEWLIB_VERSION || defined __APPLE__ +# ifdef __DragonFly__ + struct __FILE_public *fpp = (struct __FILE_public *)fp; + fpp->_p -= AUTO_DETECT_SIZE; + fpp->_r += AUTO_DETECT_SIZE; +# else fp->_p -= AUTO_DETECT_SIZE; fp->_r += AUTO_DETECT_SIZE; +# endif #elif defined __GLIBC__ fp->_IO_read_ptr = fp->_IO_read_base; #elif defined _MSC_VER || defined __MINGW_H || defined _ISO_STDIO_ISO_H