aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2012-11-04 17:59:00 -0800
committerPaul Eggert2012-11-04 17:59:00 -0800
commit8148369cfba2c982a87fb4eb72d024e26e193a03 (patch)
treee19d89cea76bbb91f5848e8382fc84c8feeb1ebb
parent06b63c9b0c6fd87e699ba6ba3be959bfd150ef8a (diff)
downloademacs-8148369cfba2c982a87fb4eb72d024e26e193a03.tar.gz
emacs-8148369cfba2c982a87fb4eb72d024e26e193a03.zip
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.
-rw-r--r--ChangeLog8
-rw-r--r--admin/CPP-DEFINES1
-rw-r--r--admin/ChangeLog5
-rw-r--r--configure.ac98
-rw-r--r--src/ChangeLog7
-rw-r--r--src/dispnew.c6
6 files changed, 24 insertions, 101 deletions
diff --git a/ChangeLog b/ChangeLog
index a344ec765d8..83026bc5065 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
12012-11-05 Paul Eggert <eggert@cs.ucla.edu>
2
3 Simplify by assuming __fpending.
4 Now that Emacs is using the gnulib fpending module,
5 there's no need for Emacs to have a separate implementation.
6 * configure.ac (stdio_ext.h, __fpending): Remove now-duplicate checks.
7 (PENDING_OUTPUT_COUNT, DISPNEW_NEEDS_STDIO_EXT): Remove.
8
12012-11-03 Eli Zaretskii <eliz@gnu.org> 92012-11-03 Eli Zaretskii <eliz@gnu.org>
2 10
3 * lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/fpending.$(O) and 11 * lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/fpending.$(O) and
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
index 661cde9c43e..fb217fc22e6 100644
--- a/admin/CPP-DEFINES
+++ b/admin/CPP-DEFINES
@@ -425,7 +425,6 @@ ORDINARY_LINK
425O_RDONLY 425O_RDONLY
426O_RDWR 426O_RDWR
427PAGESIZE 427PAGESIZE
428PENDING_OUTPUT_COUNT
429PREFER_VSUSP 428PREFER_VSUSP
430PTY_ITERATION 429PTY_ITERATION
431PTY_NAME_SPRINTF 430PTY_NAME_SPRINTF
diff --git a/admin/ChangeLog b/admin/ChangeLog
index ccb54a0a9ed..c48faadab16 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,8 @@
12012-11-05 Paul Eggert <eggert@cs.ucla.edu>
2
3 Simplify by assuming __fpending.
4 * CPP-DEFINES (PENDING_OUTPUT_COUNT): Remove.
5
12012-11-03 Glenn Morris <rgm@gnu.org> 62012-11-03 Glenn Morris <rgm@gnu.org>
2 7
3 * admin.el (set-copyright): Add msdos/sed2v2.inp. 8 * admin.el (set-copyright): Add msdos/sed2v2.inp.
diff --git a/configure.ac b/configure.ac
index b0711923e1a..9a562a37a8d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1266,7 +1266,7 @@ fi
1266dnl checks for header files 1266dnl checks for header files
1267AC_CHECK_HEADERS_ONCE( 1267AC_CHECK_HEADERS_ONCE(
1268 linux/version.h sys/systeminfo.h 1268 linux/version.h sys/systeminfo.h
1269 stdio_ext.h fcntl.h coff.h pty.h 1269 fcntl.h coff.h pty.h
1270 sys/vlimit.h sys/resource.h 1270 sys/vlimit.h sys/resource.h
1271 sys/utsname.h pwd.h utmp.h dirent.h util.h) 1271 sys/utsname.h pwd.h utmp.h dirent.h util.h)
1272 1272
@@ -2874,7 +2874,7 @@ closedir getrusage get_current_dir_name \
2874lrand48 setsid \ 2874lrand48 setsid \
2875fpathconf select euidaccess getpagesize setlocale \ 2875fpathconf select euidaccess getpagesize setlocale \
2876utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \ 2876utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \
2877__fpending strsignal setitimer \ 2877strsignal setitimer \
2878sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \ 2878sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
2879gai_strerror mkstemp getline getdelim fsync sync \ 2879gai_strerror mkstemp getline getdelim fsync sync \
2880difftime posix_memalign \ 2880difftime posix_memalign \
@@ -3650,100 +3650,6 @@ case $opsys in
3650esac 3650esac
3651 3651
3652 3652
3653dnl Used in dispnew.c
3654AH_TEMPLATE(PENDING_OUTPUT_COUNT, [Number of chars of output in the
3655 buffer of a stdio stream.])
3656
3657AC_MSG_CHECKING([whether we are using the GNU C library])
3658AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
3659#include <features.h>
3660#ifndef __GNU_LIBRARY__
3661# error "this is not the GNU C library"
3662#endif
3663 ]], [[]])], emacs_glibc=yes, emacs_glibc=no)
3664AC_MSG_RESULT([$emacs_glibc])
3665
3666if test $emacs_glibc = yes; then
3667
3668 emacs_pending_output=unknown
3669
3670 case $opsys in
3671 gnu | gnu-linux | gnu-kfreebsd )
3672 AC_MSG_CHECKING([for style of pending output formalism])
3673 dnl In autoconf 2.67 and later, we could use a single test
3674 dnl since the preprocessed output is accessible in "conftest.i".
3675 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
3676#include <stdio.h>
3677#if !defined (_IO_STDIO_H) && !defined (_STDIO_USES_IOSTREAM)
3678# error "stdio definitions not found"
3679#endif
3680 ]], [[]])], emacs_pending_output=new, [])
3681
3682 if test $emacs_pending_output = unknown; then
3683 case $opsys in
3684 gnu-linux | gnu-kfreebsd)
3685 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
3686#include <stdio.h>
3687#ifndef __UCLIBC__
3688# error "not using uclibc"
3689#endif
3690 ]], [[]])], emacs_pending_output=uclibc, emacs_pending_output=old)
3691 ;;
3692 esac
3693 fi
3694
3695 AC_MSG_RESULT([$emacs_pending_output])
3696
3697 case $emacs_pending_output in
3698 new)
3699 dnl New C libio names.
3700 AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
3701 [((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)])
3702 ;;
3703 uclibc)
3704 dnl Using the uClibc library.
3705 AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
3706 [((FILE)->__bufpos - (FILE)->__bufstart)])
3707 ;;
3708 old)
3709 dnl Old C++ iostream names.
3710 AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
3711 [((FILE)->_pptr - (FILE)->_pbase)])
3712 ;;
3713 esac
3714 ;;
3715 esac dnl opsys
3716
3717 if test $emacs_pending_output = unknown; then
3718 AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__bufp - (FILE)->__buffer)])
3719 fi
3720
3721else dnl !emacs_glibc
3722
3723 case $opsys in
3724 cygwin | darwin | freebsd | netbsd | openbsd )
3725 AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_p - (FILE)->_bf._base)])
3726 ;;
3727
3728 unixware)
3729 AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__ptr - (FILE)->__base)])
3730 ;;
3731
3732 *)
3733 dnl HAVE_STDIO_EXT_H && HAVE___FPENDING
3734 if test x$ac_cv_header_stdio_ext_h = xyes && \
3735 test x$ac_cv_func___fpending = xyes; then
3736 AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [__fpending (FILE)])
3737 AC_DEFINE(DISPNEW_NEEDS_STDIO_EXT, 1,
3738 [Define if dispnew.c should include stdio_ext.h.])
3739 else
3740 AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_ptr - (FILE)->_base)])
3741 fi
3742 ;;
3743 esac
3744fi dnl emacs_glibc
3745
3746
3747dnl Used in vm-limit.c 3653dnl Used in vm-limit.c
3748AH_TEMPLATE(DATA_START, [Address of the start of the data segment.]) 3654AH_TEMPLATE(DATA_START, [Address of the start of the data segment.])
3749dnl Used in lisp.h, emacs.c, mem-limits.h 3655dnl Used in lisp.h, emacs.c, mem-limits.h
diff --git a/src/ChangeLog b/src/ChangeLog
index 75b70ee4752..29efd9f181c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12012-11-05 Paul Eggert <eggert@cs.ucla.edu>
2
3 Simplify by assuming __fpending.
4 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
5 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
6 Do not assume that __fpending's result fits in int.
7
12012-11-04 Paul Eggert <eggert@cs.ucla.edu> 82012-11-04 Paul Eggert <eggert@cs.ucla.edu>
2 9
3 Remove EMACS_OUTQSIZE+sleep hack. 10 Remove EMACS_OUTQSIZE+sleep hack.
diff --git a/src/dispnew.c b/src/dispnew.c
index 2ddd29139af..907259a3e94 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -53,9 +53,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
53#include "systime.h" 53#include "systime.h"
54#include <errno.h> 54#include <errno.h>
55 55
56#ifdef DISPNEW_NEEDS_STDIO_EXT 56#include <fpending.h>
57#include <stdio_ext.h>
58#endif
59 57
60#if defined (HAVE_TERM_H) && defined (GNU_LINUX) 58#if defined (HAVE_TERM_H) && defined (GNU_LINUX)
61#include <term.h> /* for tgetent */ 59#include <term.h> /* for tgetent */
@@ -4647,7 +4645,7 @@ update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p)
4647 FILE *display_output = FRAME_TTY (f)->output; 4645 FILE *display_output = FRAME_TTY (f)->output;
4648 if (display_output) 4646 if (display_output)
4649 { 4647 {
4650 int outq = PENDING_OUTPUT_COUNT (display_output); 4648 ptrdiff_t outq = __fpending (display_output);
4651 if (outq > 900 4649 if (outq > 900
4652 || (outq > 20 && ((i - 1) % preempt_count == 0))) 4650 || (outq > 20 && ((i - 1) % preempt_count == 0)))
4653 fflush (display_output); 4651 fflush (display_output);