Ignore:
Timestamp:
Jan 13, 2010, 12:53:30 AM (11 years ago)
Author:
Sam Hocevar
Message:

Reorganise FILE structure autoconf tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/libzzuf/lib-stream.c

    r4238 r4248  
    2424#define __EXTENSIONS__
    2525
    26 /* Define if stdio operations use *only* the refill mechanism */
    27 #if defined HAVE___SREFILL
    28 #   define HAVE_DARWIN_STDIO
    29 #elif defined HAVE___FILBUF || defined HAVE___SRGET || defined HAVE___UFLOW
    30 #   define HAVE_BSD_STDIO
    31 #endif
    32 
    3326/* Define the best ftell() clone */
    3427#if defined HAVE_FTELLO64
     
    176169static inline uint8_t *get_stream_ptr(FILE *stream)
    177170{
    178 #if defined HAVE_BSD_STDIO
    179     return (uint8_t *)stream->FILE_PTR;
     171#if defined HAVE_GLIBC_FILE
     172    return (uint8_t *)stream->_IO_read_ptr;
     173#elif defined HAVE_FREEBSD_FILE
     174    return (uint8_t *)stream->_p;
    180175#else
    181176    (void)stream;
     
    186181static inline int get_stream_off(FILE *stream)
    187182{
    188 #if defined HAVE_BSD_STDIO
    189     return (int)((uint8_t *)stream->FILE_PTR - (uint8_t *)stream->FILE_BASE);
     183#if defined HAVE_GLIBC_FILE
     184    return (int)((uint8_t *)stream->_IO_read_ptr
     185                  - (uint8_t *)stream->_IO_read_base);
     186#elif defined HAVE_FREEBSD_FILE
     187    return (int)((uint8_t *)stream->_p - (uint8_t *)stream->_bf._base);
    190188#else
    191189    (void)stream;
     
    196194static inline int get_stream_cnt(FILE *stream)
    197195{
    198 #if defined HAVE_GLIBC_FP
    199     return (int)((uint8_t *)stream->FILE_CNT - (uint8_t *)stream->FILE_PTR);
    200 #elif defined HAVE_BSD_STDIO
    201     return stream->FILE_CNT;
     196#if defined HAVE_GLIBC_FILE
     197    return (int)((uint8_t *)stream->_IO_read_end
     198                  - (uint8_t *)stream->_IO_read_ptr);
     199#elif defined HAVE_FREEBSD_FILE
     200    return stream->_r;
    202201#else
    203202    (void)stream;
Note: See TracChangeset for help on using the changeset viewer.