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/configure.ac

    r4244 r4248  
    7878AC_DEFINE_UNQUOTED(RECV_T, $ac_v_recv_t, [Define to the recv() return type])
    7979
    80 AC_MSG_CHECKING(for FILE* internal members)
    81 ac_cv_have_glibc_fp="no"
    82 ac_v_fp_base="unknown"
    83 ac_v_fp_ptr="unknown"
    84 ac_v_fp_cnt="unknown"
     80AC_MSG_CHECKING([for _IO_read_ptr and _IO_read_end in FILE (glibc-style)])
    8581AC_TRY_COMPILE([#include <stdio.h>],
    8682 [FILE *fp; fp->_IO_read_ptr++; fp->_IO_read_end++],
    87  [ac_cv_have_glibc_fp=yes; ac_v_fp_base=_IO_read_base
    88   ac_v_fp_cnt=_IO_read_end; ac_v_fp_ptr=_IO_read_ptr],
    89  [AC_TRY_COMPILE([#include <stdio.h>],
    90    [FILE *fp; fp->__cnt++; fp->__ptr++],
    91    [ac_v_fp_base=FIXME; ac_v_fp_ptr=__ptr; ac_v_fp_cnt=__cnt],
    92    [AC_TRY_COMPILE([#include <stdio.h>],
    93      [FILE *fp; fp->_cnt++; fp->_ptr++],
    94      [ac_v_fp_base=FIXME; ac_v_fp_ptr=_ptr; ac_v_fp_cnt=_cnt],
    95      [AC_TRY_COMPILE([#include <stdio.h>],
    96        [FILE *fp; fp->_c++; fp->_p++],
    97        [ac_v_fp_base=FIXME; ac_v_fp_ptr=_p; ac_v_fp_cnt=_c],
    98        [AC_TRY_COMPILE([#include <stdio.h>],
    99          [FILE *fp; fp->_bf._base++; fp->_r++; fp->_p++],
    100          [ac_v_fp_base=_bf._base; ac_v_fp_ptr=_p; ac_v_fp_cnt=_r])])])])])
    101 AC_MSG_RESULT($ac_v_fp_base/$ac_v_fp_ptr/$ac_v_fp_cnt)
    102 if test "$ac_cv_have_glibc_fp" != "no"; then
    103   AC_DEFINE(HAVE_GLIBC_FP, 1, [Define to 1 if FILE has glibc-style members])
     83 [ac_cv_have_file_io_read_ptr=yes],
     84 [ac_cv_have_file_io_read_ptr=no])
     85AC_MSG_RESULT($ac_cv_have_file_io_read_ptr)
     86if test "$ac_cv_have_file_io_read_ptr" != "no"; then
     87  AC_DEFINE(HAVE_GLIBC_FILE, 1, [Define to 1 if FILE has glibc-style members])
    10488fi
    105 AC_DEFINE_UNQUOTED(FILE_BASE, $ac_v_fp_base, [Define to the FILE::base member])
    106 AC_DEFINE_UNQUOTED(FILE_PTR, $ac_v_fp_ptr, [Define to the FILE::ptr member])
    107 AC_DEFINE_UNQUOTED(FILE_CNT, $ac_v_fp_cnt, [Define to the FILE::cnt member])
     89
     90AC_MSG_CHECKING([for _bf._base, _r and _p in FILE (FreeBSD-style)])
     91AC_TRY_COMPILE([#include <stdio.h>],
     92 [FILE *fp; fp->_bf._base++; fp->_r++; fp->_p++],
     93 [ac_cv_have_file_bf_base=yes],
     94 [ac_cv_have_file_bf_base=no])
     95AC_MSG_RESULT($ac_cv_have_file_bf_base)
     96if test "$ac_cv_have_file_bf_base" != "no"; then
     97  AC_DEFINE(HAVE_FREEBSD_FILE, 1, [Define to 1 if FILE has FreeBSD-style members])
     98fi
    10899
    109100dnl  On HP-UX, fpos64_t == int64_t, but on Linux it's a compound object.
Note: See TracChangeset for help on using the changeset viewer.