Changeset 2553

Show
Ignore:
Timestamp:
07/16/08 23:37:12 (3 months ago)
Author:
sam
Message:
  • lib-stream.c: try to make the filbuf() implementation portable across HP-UX and OpenSolaris?.
Location:
zzuf/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/configure.ac

    r2552 r2553  
    6868AC_DEFINE_UNQUOTED(RECV_T, $ac_v_recv_t, [Define to the recv() return type]) 
    6969 
     70AC_MSG_CHECKING(for FILE* internal members) 
     71ac_v_fp_cnt="unknown" 
     72ac_v_fp_ptr="unknown" 
     73AC_TRY_COMPILE([#include <stdio.h>], 
     74 [FILE *fp; fp->__cnt++; fp->__ptr++], 
     75 [ac_v_fp_cnt=__cnt; ac_v_fp_ptr=__ptr]) 
     76AC_TRY_COMPILE([#include <stdio.h>], 
     77 [FILE *fp; fp->_cnt++; fp->_ptr++], 
     78 [ac_v_fp_cnt=_cnt; ac_v_fp_ptr=_ptr]) 
     79AC_TRY_COMPILE([#include <stdio.h>], 
     80 [FILE *fp; fp->_c++; fp->_p++], 
     81 [ac_v_fp_cnt=_c; ac_v_fp_ptr=_p]) 
     82AC_MSG_RESULT($ac_v_fp_cnt/$ac_v_fp_ptr) 
     83AC_DEFINE_UNQUOTED(FILE_CNT, $ac_v_fp_cnt, [Define to the FILE::cnt member name]) 
     84AC_DEFINE_UNQUOTED(FILE_PTR, $ac_v_fp_ptr, [Define to the FILE::ptr member name]) 
     85 
    7086AC_MSG_CHECKING(for pragma INIT/FINI) 
    7187AC_TRY_COMPILE([], 
  • zzuf/trunk/src/lib-stream.c

    r2552 r2553  
    145145#if defined HAVE_REFILL_STDIO /* Fuzz fp if we have __srefill() */ 
    146146#   define FOPEN_FUZZ() \ 
    147     _zz_fuzz(fd, ret->__ptr, ret->__cnt) 
     147    _zz_fuzz(fd, ret->FP_PTR, ret->FP_CNT) 
    148148#else 
    149149#   define FOPEN_FUZZ() 
     
    795795    { 
    796796        if(newpos != -1) 
    797             _zz_setpos(fd, newpos - fp->__cnt - 1); 
    798         _zz_fuzz(fd, fp->__ptr - 1, fp->__cnt + 1); 
    799         ret = (uint8_t)fp->__ptr[-1]; 
    800         _zz_addpos(fd, fp->__cnt + 1); 
     797            _zz_setpos(fd, newpos - fp->FP_CNT - 1); 
     798        _zz_fuzz(fd, fp->FP_PTR - 1, fp->FP_CNT + 1); 
     799        ret = (uint8_t)fp->FP_PTR[-1]; 
     800        _zz_addpos(fd, fp->FP_CNT + 1); 
    801801    } 
    802802