]> code.delx.au - gnu-emacs/commitdiff
Remove GNU_LIBRARY_PENDING_OUTPUT_COUNT
authorGlenn Morris <rgm@gnu.org>
Mon, 6 Aug 2012 20:22:22 +0000 (16:22 -0400)
committerGlenn Morris <rgm@gnu.org>
Mon, 6 Aug 2012 20:22:22 +0000 (16:22 -0400)
* configure.ac (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Remove.
(PENDING_OUTPUT_COUNT): Absorb GNU_LIBRARY_PENDING_OUTPUT_COUNT.
(DISPNEW_NEEDS_STDIO_EXT): New define.

* src/dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
Let configure handle it.
(stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.

* nt/config.nt (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Remove.
(PENDING_OUTPUT_COUNT): Define it as dispnew.c used to.

* admin/CPP-DEFINES (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Remove.

ChangeLog
admin/CPP-DEFINES
configure.ac
nt/ChangeLog
nt/config.nt
src/ChangeLog
src/dispnew.c

index e996efbe2e4f5ac2ff21ce351c5fabf3011e00aa..f5883f9cc00aacff4a992e1dbbe5edca479d004a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-08-06  Glenn Morris  <rgm@gnu.org>
+
+       * configure.ac (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Remove.
+       (PENDING_OUTPUT_COUNT): Absorb GNU_LIBRARY_PENDING_OUTPUT_COUNT.
+       (DISPNEW_NEEDS_STDIO_EXT): New define.
+
 2012-08-05  Michael Albinus  <michael.albinus@gmx.de>
 
        * INSTALL: Explain, how to disable D-Bus at all.  (Bug#12112)
index 47453f504678e234229898fc8a9290f523494fc3..ce7005afc012b67082416cd0171d80c573cd2060 100644 (file)
@@ -112,7 +112,6 @@ GC_MARK_SECONDARY_STACK
 GC_MARK_STACK
 GC_SETJMP_WORKS
 GMALLOC_INHIBIT_VALLOC
-GNU_LIBRARY_PENDING_OUTPUT_COUNT
 GNU_MALLOC
 HAVE_AIX_SMT_EXP
 HAVE_CBRT
index 2a6291e82435182b2ec07e844173d819237a9a4c..b4fe8bc0b9f68e3c165d41779211f8a5e47a12a0 100644 (file)
@@ -3506,31 +3506,32 @@ esac
 
 dnl Used in dispnew.c
 AH_TEMPLATE(PENDING_OUTPUT_COUNT, [Number of chars of output in the
-buffer of a stdio stream.])
+  buffer of a stdio stream.])
 
-dnl FIXME just PENDING_OUTPUT_COUNT should suffice.
-AH_TEMPLATE(GNU_LIBRARY_PENDING_OUTPUT_COUNT, [Value of
-PENDING_OUTPUT_COUNT if using the GNU C library.])
+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])
 
-case $opsys in
-  cygwin | darwin | freebsd | netbsd | openbsd )
-    AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_p - (FILE)->_bf._base)])
-    ;;
+if test $emacs_glibc = yes; then
 
-  unixware)
-    AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__ptr - (FILE)->__base)])
-    ;;
+  emacs_pending_output=unknown
 
-  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([[
+  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, emacs_pending_output=unknown)
+        ]], [[]])], emacs_pending_output=new, [])
 
       if test $emacs_pending_output = unknown; then
         case $opsys in
@@ -3550,22 +3551,51 @@ case $opsys in
       case $emacs_pending_output in
         new)
           dnl New C libio names.
-          AC_DEFINE(GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE),
+          AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
             [((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)])
           ;;
         uclibc)
           dnl Using the uClibc library.
-          AC_DEFINE(GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE),
+          AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
             [((FILE)->__bufpos - (FILE)->__bufstart)])
           ;;
         old)
           dnl Old C++ iostream names.
-          AC_DEFINE(GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE),
+          AC_DEFINE(PENDING_OUTPUT_COUNT(FILE),
             [((FILE)->_pptr - (FILE)->_pbase)])
           ;;
       esac
     ;;
-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
index ffdfb5dcab2b60657b744fcc344e5b22e3b52ed5..11d62250c206a160c5f8c30f4bfc50cfa9e28872 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-06  Glenn Morris  <rgm@gnu.org>
+
+       * config.nt (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Remove.
+       (PENDING_OUTPUT_COUNT): Define it as dispnew.c used to.
+
 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
 
        * paths.h (PATH_LOADSEARCH, PATH_SITELOADSEARCH, PATH_EXEC)
index abc90687e3fd559e82877373dc5945d78440cb3e..f0bcce7a285884b17cb7f2158ea3da66a676f0b3 100644 (file)
@@ -211,9 +211,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    whether the gnulib module scanf shall be considered present. */
 #undef GNULIB_SCANF
 
-/* Value of PENDING_OUTPUT_COUNT if using the GNU C library. */
-#undef GNU_LIBRARY_PENDING_OUTPUT_COUNT
-
 /* Define if ths system is compatible with GNU/Linux. */
 #undef GNU_LINUX
 
@@ -1229,7 +1226,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #undef PACKAGE_VERSION
 
 /* Number of chars of output in the buffer of a stdio stream. */
-#undef PENDING_OUTPUT_COUNT
+#ifdef __GNU_LIBRARY__
+#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->__bufp - (FILE)->__buffer)
+#else
+#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base)
+#endif
 
 /* Define to empty to suppress deprecation warnings when building with
    --enable-gcc-warnings and with libpng versions before 1.5, which lack
index d08802f5f56d7d9e74115a8525dafaca12c49c63..ec3f08fc6a0adda8ce125302a8e936e431329aa9 100644 (file)
@@ -1,3 +1,9 @@
+2012-08-06  Glenn Morris  <rgm@gnu.org>
+
+       * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
+       Let configure handle it.
+       (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
+
 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
 
        Use GCALIGNMENT where appropriate.
index 10206ecd43b50ae0562e18998d8626968170726b..d06ab594b2f05640358952a5f5ae15aafd39bde6 100644 (file)
@@ -65,33 +65,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "systime.h"
 #include <errno.h>
 
-/* Get number of chars of output now in the buffer of a stdio stream.
-   This ought to be built in stdio, but it isn't.  Some s- files
-   override this because their stdio internals differ.  */
-#ifdef __GNU_LIBRARY__
-
-/* The s- file might have overridden the definition with one that
-   works for the system's C library.  But we are using the GNU C
-   library, so this is the right definition for every system.  */
-#ifdef GNU_LIBRARY_PENDING_OUTPUT_COUNT
-#define PENDING_OUTPUT_COUNT GNU_LIBRARY_PENDING_OUTPUT_COUNT
-#else
-#undef PENDING_OUTPUT_COUNT
-#define        PENDING_OUTPUT_COUNT(FILE) ((FILE)->__bufp - (FILE)->__buffer)
-#endif
-
-/* not __GNU_LIBRARY__ and no PENDING_OUTPUT_COUNT defined  */
-#elif !defined (PENDING_OUTPUT_COUNT)
-
-#if HAVE_STDIO_EXT_H && HAVE___FPENDING
+#ifdef DISPNEW_NEEDS_STDIO_EXT
 #include <stdio_ext.h>
-#define PENDING_OUTPUT_COUNT(FILE) __fpending (FILE)
-#else
-#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base)
 #endif
 
-#endif /* not __GNU_LIBRARY__ and no PENDING_OUTPUT_COUNT defined */
-
 #if defined (HAVE_TERM_H) && defined (GNU_LINUX)
 #include <term.h>              /* for tgetent */
 #endif