4 dnl Using code from emacs, based on suggestions from Paul Eggert
5 dnl and Ulrich Drepper.
7 AC_DEFUN(jm_FUNC_FPENDING,
9 AC_CHECK_HEADERS(stdio_ext.h)
10 AC_FEPLACE_FUNCS([__fpending])
11 if test $ac_cv_func___fpending = no; then
12 AC_REPLACE_FUNCS(__fpending)
14 [how to determine the number of pending output bytes on a stream],
15 ac_cv_sys_pending_output_n_bytes,
21 'fp->_IO_write_ptr - fp->_IO_write_base' \
23 '# traditional Unix' \
24 'fp->_ptr - fp->_base' \
27 'fp->_p - fp->_bf._base' \
30 'fp->__ptr - fp->__base' \
33 'fp->__bufp - fp->__buffer' \
35 '# old glibc iostream?' \
36 'fp->_pptr - fp->_pbase' \
39 '(*fp)->_ptr - (*fp)->_base' \
41 '# e.g., DGUX R4.11; the info is not available' \
44 # Skip each embedded comment.
45 case "$ac_expr" in '#'*) continue;; esac
48 DEFS="$DEFS -DPENDING_OUTPUT_N_BYTES=$ac_expr"
52 [long unsigned int n = $ac_expr;],
56 test "$fp_done" = yes && break
58 AC_DEFINE_UNQUOTED(PENDING_OUTPUT_N_BYTES, $ac_expr,
59 [the number of pending output bytes on stream `fp'])
66 if test $fu_cv_sys_struct_timespec = yes; then
67 AC_DEFINE_UNQUOTED(HAVE_STRUCT_TIMESPEC, 1,
68 [Define if struct timespec is declared in <time.h>. ])