mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 04:10:54 -08:00
Simplify by assuming __fpending.
Now that Emacs is using the gnulib fpending module, there's no need for Emacs to have a separate implementation. * configure.ac (stdio_ext.h, __fpending): Remove now-duplicate checks. (PENDING_OUTPUT_COUNT, DISPNEW_NEEDS_STDIO_EXT): Remove. * admin/CPP-DEFINES (PENDING_OUTPUT_COUNT): Remove. * src/dispnew.c: Include <fpending.h>, not <stdio_ext.h>. (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT. Do not assume that __fpending's result fits in int.
This commit is contained in:
parent
06b63c9b0c
commit
8148369cfb
6 changed files with 24 additions and 101 deletions
|
|
@ -1,3 +1,11 @@
|
|||
2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Simplify by assuming __fpending.
|
||||
Now that Emacs is using the gnulib fpending module,
|
||||
there's no need for Emacs to have a separate implementation.
|
||||
* configure.ac (stdio_ext.h, __fpending): Remove now-duplicate checks.
|
||||
(PENDING_OUTPUT_COUNT, DISPNEW_NEEDS_STDIO_EXT): Remove.
|
||||
|
||||
2012-11-03 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/fpending.$(O) and
|
||||
|
|
|
|||
|
|
@ -425,7 +425,6 @@ ORDINARY_LINK
|
|||
O_RDONLY
|
||||
O_RDWR
|
||||
PAGESIZE
|
||||
PENDING_OUTPUT_COUNT
|
||||
PREFER_VSUSP
|
||||
PTY_ITERATION
|
||||
PTY_NAME_SPRINTF
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Simplify by assuming __fpending.
|
||||
* CPP-DEFINES (PENDING_OUTPUT_COUNT): Remove.
|
||||
|
||||
2012-11-03 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* admin.el (set-copyright): Add msdos/sed2v2.inp.
|
||||
|
|
|
|||
98
configure.ac
98
configure.ac
|
|
@ -1266,7 +1266,7 @@ fi
|
|||
dnl checks for header files
|
||||
AC_CHECK_HEADERS_ONCE(
|
||||
linux/version.h sys/systeminfo.h
|
||||
stdio_ext.h fcntl.h coff.h pty.h
|
||||
fcntl.h coff.h pty.h
|
||||
sys/vlimit.h sys/resource.h
|
||||
sys/utsname.h pwd.h utmp.h dirent.h util.h)
|
||||
|
||||
|
|
@ -2874,7 +2874,7 @@ closedir getrusage get_current_dir_name \
|
|||
lrand48 setsid \
|
||||
fpathconf select euidaccess getpagesize setlocale \
|
||||
utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \
|
||||
__fpending strsignal setitimer \
|
||||
strsignal setitimer \
|
||||
sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
|
||||
gai_strerror mkstemp getline getdelim fsync sync \
|
||||
difftime posix_memalign \
|
||||
|
|
@ -3650,100 +3650,6 @@ case $opsys in
|
|||
esac
|
||||
|
||||
|
||||
dnl Used in dispnew.c
|
||||
AH_TEMPLATE(PENDING_OUTPUT_COUNT, [Number of chars of output in the
|
||||
buffer of a stdio stream.])
|
||||
|
||||
AC_MSG_CHECKING([whether we are using the GNU C library])
|
||||
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <features.h>
|
||||
#ifndef __GNU_LIBRARY__
|
||||
# error "this is not the GNU C library"
|
||||
#endif
|
||||
]], [[]])], emacs_glibc=yes, emacs_glibc=no)
|
||||
AC_MSG_RESULT([$emacs_glibc])
|
||||
|
||||
if test $emacs_glibc = yes; then
|
||||
|
||||
emacs_pending_output=unknown
|
||||
|
||||
case $opsys in
|
||||
gnu | gnu-linux | gnu-kfreebsd )
|
||||
AC_MSG_CHECKING([for style of pending output formalism])
|
||||
dnl In autoconf 2.67 and later, we could use a single test
|
||||
dnl since the preprocessed output is accessible in "conftest.i".
|
||||
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <stdio.h>
|
||||
#if !defined (_IO_STDIO_H) && !defined (_STDIO_USES_IOSTREAM)
|
||||
# error "stdio definitions not found"
|
||||
#endif
|
||||
]], [[]])], emacs_pending_output=new, [])
|
||||
|
||||
if test $emacs_pending_output = unknown; then
|
||||
case $opsys in
|
||||
gnu-linux | gnu-kfreebsd)
|
||||
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <stdio.h>
|
||||
#ifndef __UCLIBC__
|
||||
# error "not using uclibc"
|
||||
#endif
|
||||
]], [[]])], emacs_pending_output=uclibc, emacs_pending_output=old)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$emacs_pending_output])
|
||||
|
||||
case $emacs_pending_output in
|
||||
new)
|
||||
dnl New C libio names.
|
||||
AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
|
||||
[((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)])
|
||||
;;
|
||||
uclibc)
|
||||
dnl Using the uClibc library.
|
||||
AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
|
||||
[((FILE)->__bufpos - (FILE)->__bufstart)])
|
||||
;;
|
||||
old)
|
||||
dnl Old C++ iostream names.
|
||||
AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
|
||||
[((FILE)->_pptr - (FILE)->_pbase)])
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac dnl opsys
|
||||
|
||||
if test $emacs_pending_output = unknown; then
|
||||
AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__bufp - (FILE)->__buffer)])
|
||||
fi
|
||||
|
||||
else dnl !emacs_glibc
|
||||
|
||||
case $opsys in
|
||||
cygwin | darwin | freebsd | netbsd | openbsd )
|
||||
AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_p - (FILE)->_bf._base)])
|
||||
;;
|
||||
|
||||
unixware)
|
||||
AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__ptr - (FILE)->__base)])
|
||||
;;
|
||||
|
||||
*)
|
||||
dnl HAVE_STDIO_EXT_H && HAVE___FPENDING
|
||||
if test x$ac_cv_header_stdio_ext_h = xyes && \
|
||||
test x$ac_cv_func___fpending = xyes; then
|
||||
AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [__fpending (FILE)])
|
||||
AC_DEFINE(DISPNEW_NEEDS_STDIO_EXT, 1,
|
||||
[Define if dispnew.c should include stdio_ext.h.])
|
||||
else
|
||||
AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_ptr - (FILE)->_base)])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi dnl emacs_glibc
|
||||
|
||||
|
||||
dnl Used in vm-limit.c
|
||||
AH_TEMPLATE(DATA_START, [Address of the start of the data segment.])
|
||||
dnl Used in lisp.h, emacs.c, mem-limits.h
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Simplify by assuming __fpending.
|
||||
* dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
|
||||
(update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
|
||||
Do not assume that __fpending's result fits in int.
|
||||
|
||||
2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Remove EMACS_OUTQSIZE+sleep hack.
|
||||
|
|
|
|||
|
|
@ -53,9 +53,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
|
|||
#include "systime.h"
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef DISPNEW_NEEDS_STDIO_EXT
|
||||
#include <stdio_ext.h>
|
||||
#endif
|
||||
#include <fpending.h>
|
||||
|
||||
#if defined (HAVE_TERM_H) && defined (GNU_LINUX)
|
||||
#include <term.h> /* for tgetent */
|
||||
|
|
@ -4647,7 +4645,7 @@ update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p)
|
|||
FILE *display_output = FRAME_TTY (f)->output;
|
||||
if (display_output)
|
||||
{
|
||||
int outq = PENDING_OUTPUT_COUNT (display_output);
|
||||
ptrdiff_t outq = __fpending (display_output);
|
||||
if (outq > 900
|
||||
|| (outq > 20 && ((i - 1) % preempt_count == 0)))
|
||||
fflush (display_output);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue