bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] Re: maintain unlocked-io.h by hand instead of generating it


From: Paul Eggert
Subject: [Bug-gnulib] Re: maintain unlocked-io.h by hand instead of generating it?
Date: Fri, 6 Dec 2002 11:42:20 -0800

> From: Jim Meyering <address@hidden>
> Date: Fri, 06 Dec 2002 09:46:26 +0100

> Oh... I see that your version of that test checks only for declarations.
> Plus it has an incremented serial#.
> But I don't see any explanation for that change in diffutils-2.8.4.
> 
> What!?!  You didn't like the kludges in `#serial 6'? :-)

Yes, that was much of it.  Also, I didn't see any need to cater to
ancient implementations that don't declare stdio functions, as these
implementations won't have thread-safety issues anyway.

So I installed this patch to finish the unlocked-io.h job that I left
incomplete a couple of days ago.  This propagates the diffutils method
into gnulib.  Thanks for checking on the m4 part.


2002-12-06  Paul Eggert  <address@hidden>

        Undo the 2001-07-02 change for jm-glibc-io, as it was too much of
        a pain in practice to deal with generated m4 files.  This change
        goes together with the 2002-12-04 unlocked-io.h change in ../lib.

        * Makefile.am.in (Makefile.am): Don't mention jm-glibc-io.m4n
        and jm-glibc-io.m4, as they are no longer a special case.
        * jm-glibc-io.m4: Rename from jm-glibc-io.m4n, and remove the
        kludge and the auto-generation stuff.  Check only whether the
        functions are declared, not whether they exist, since older hosts
        that don't declare the functions can't use the optimization anyway.

--- Makefile.am.in.~1.13.~      2001-07-15 07:31:54.000000000 -0700
+++ Makefile.am.in      2002-12-06 11:05:06.000000000 -0800
@@ -7,7 +7,7 @@ Makefile.am: Makefile.am.in
        rm -f $@ address@hidden
        sed -n '1,/^##m4-files-begin/p' $< > address@hidden
        (((echo EXTRA_DIST =; \
-          echo "  README jm-glibc-io.m4 jm-glibc-io.m4n Makefile.am.in" \
+          echo "  README Makefile.am.in" \
          ) | tr '\012' @); \
          (echo *.m4|tr ' ' @) ) \
          |sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \
--- /dev/null   2002-10-01 00:56:28.000000000 +0000
+++ jm-glibc-io.m4      2002-12-06 19:00:06.000000000 +0000
@@ -0,0 +1,14 @@
+#serial 7 -*- autoconf -*-
+
+dnl From Jim Meyering.
+dnl
+dnl See if the glibc *_unlocked I/O macros are available.
+dnl Use only those *_unlocked macros that are declared.
+dnl
+
+AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
+  [AC_CHECK_DECLS(
+     [clearerr_unlocked, feof_unlocked, ferror_unlocked,
+      fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
+      fread_unlocked, fwrite_unlocked, getc_unlocked,
+      getchar_unlocked, putc_unlocked, putchar_unlocked])])
--- jm-glibc-io.m4n     2001-11-03 22:22:41.000000000 +0000
+++ /dev/null   2002-10-01 00:56:28.000000000 +0000
@@ -1,33 +0,0 @@
-#serial 6 -*- autoconf -*-
-
-dnl From Jim Meyering.
-dnl
-dnl See if the glibc *_unlocked I/O macros are available.
-dnl Use only those *_unlocked macros that are declared.
-dnl
-
-AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
-  [
-    # Kludge (not executed) to make autoheader do the right thing.
-    if test a = b; then
-      AC_CHECK_DECLS(address@hidden@])
-      AC_CHECK_FUNCS(@space_separated@)
-    fi
-
-    io_functions='@space_separated@'
-
-    for jm_io_func in $io_functions; do
-      # Check for the existence of each function only if it is declared.
-      # Otherwise, we'd get the Solaris5.5.1 functions that are not
-      # declared, and that have been removed from Solaris5.6.  The resulting
-      # 5.5.1 binaries would not run on 5.6 due to shared library differences.
-      AC_CHECK_DECLS([$jm_io_func],
-                    jm_declared=yes,
-                    jm_declared=no,
-                    [#include <stdio.h>])
-      if test $jm_declared = yes; then
-        AC_CHECK_FUNCS($jm_io_func)
-      fi
-    done
-  ]
-)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]