]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Update 'unlocked-io' module from gnulib.
authorBruno Haible <bruno@clisp.org>
Tue, 11 Jan 2005 13:15:16 +0000 (13:15 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:12:00 +0000 (12:12 +0200)
gettext-runtime/ChangeLog
gettext-runtime/Makefile.am
gettext-tools/ChangeLog
gettext-tools/Makefile.am
gettext-tools/lib/ChangeLog
gettext-tools/lib/unlocked-io.h
gettext-tools/m4/ChangeLog
gettext-tools/m4/unlocked-io.m4

index 0f79421814c1b691213669016ea042b02fea4bc4..a3dd08fb67c8bb965ea97d635311c6af6e46c5d8 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-06  Bruno Haible  <bruno@clisp.org>
+
+       * Makefile.am (config.h_vms, config.h.msvc): Define USE_UNLOCKED_IO
+       to 1.
+
 2005-01-05  Bruno Haible  <bruno@clisp.org>
 
        * windows/intl.rc: Update copyright year.
index f2be2093441ae33b3c6a80f1a8d915424c1c5b9c..f0db51ee0a831cdc4a121be21b71e7e07e03bce9 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile for the gettext-runtime directory of GNU gettext
-## Copyright (C) 1995-1999, 2000-2004 Free Software Foundation, Inc.
+## Copyright (C) 1995-1999, 2000-2005 Free Software Foundation, Inc.
 ##
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -100,6 +100,7 @@ config.h_vms: config.h.in ../version.sh
             -e 's/#undef ICONV_CONST$$/#define ICONV_CONST/' \
             -e 's/#undef MALLOC_0_IS_NONNULL$$/#define MALLOC_0_IS_NONNULL 0/' \
             -e 's/#undef STDC_HEADERS$$/#define STDC_HEADERS 1/' \
+            -e 's/#undef USE_UNLOCKED_IO$$/#define USE_UNLOCKED_IO 1/' \
             -e 's/#undef realpath$$/#define realpath rpl_realpath/' \
             -e 's/#undef uintmax_t$$/#define uintmax_t unsigned long long/' \
             -e 's/#undef PACKAGE$$/#define PACKAGE "gettext-runtime"/' \
@@ -159,6 +160,7 @@ config.h.msvc: config.h.in ../version.sh
            -e 's/#undef SIZE_MAX$$/#define SIZE_MAX 4294967295U/' \
            -e 's/#undef STACK_DIRECTION$$/#define STACK_DIRECTION -1/' \
            -e 's/#undef STDC_HEADERS$$/#define STDC_HEADERS 1/' \
+           -e 's/#undef USE_UNLOCKED_IO$$/#define USE_UNLOCKED_IO 1/' \
            -e 's/#undef inline$$/#define inline __inline/' \
            -e 's/#undef ssize_t$$/#define ssize_t int/' \
            -e 's/#undef uintmax_t$$/#define uintmax_t unsigned long/' \
index b06aaf8b71e9cbc1cfe2cf6ae07b83a246d37b54..01979c9aedaadf961d9b831788d02ab9a1b4f48d 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-06  Bruno Haible  <bruno@clisp.org>
+
+       * Makefile.am (config.h_vms, config.h.msvc): Define USE_UNLOCKED_IO
+       to 1.
+
 2005-01-05  Bruno Haible  <bruno@clisp.org>
 
        * windows/gettextlib.rc: Update copyright year.
index b65a02f2150257df140b0b59fdceb2676e09a87e..3b2d1bb1a27fa9e419e0ebeba1b0a70b00aa59c3 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile for the gettext-tools directory of GNU gettext
-## Copyright (C) 1995-1999, 2000-2004 Free Software Foundation, Inc.
+## Copyright (C) 1995-1999, 2000-2005 Free Software Foundation, Inc.
 ##
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -133,6 +133,7 @@ config.h_vms: config.h.in ../version.sh
             -e 's/#undef MALLOC_0_IS_NONNULL$$/#define MALLOC_0_IS_NONNULL 0/' \
             -e 's/#undef SETLOCALE_CONST$$/#define SETLOCALE_CONST const/' \
             -e 's/#undef STDC_HEADERS$$/#define STDC_HEADERS 1/' \
+            -e 's/#undef USE_UNLOCKED_IO$$/#define USE_UNLOCKED_IO 1/' \
             -e 's/#undef eaccess$$/#define eaccess access/' \
             -e 's/#undef fnmatch$$/#define fnmatch rpl_fnmatch/' \
             -e 's/#undef getline$$/#define getline rpl_getline/' \
@@ -203,6 +204,7 @@ config.h.msvc: config.h.in ../version.sh
            -e 's/#undef SIZE_MAX$$/#define SIZE_MAX 4294967295U/' \
            -e 's/#undef STACK_DIRECTION$$/#define STACK_DIRECTION -1/' \
            -e 's/#undef STDC_HEADERS$$/#define STDC_HEADERS 1/' \
+           -e 's/#undef USE_UNLOCKED_IO$$/#define USE_UNLOCKED_IO 1/' \
            -e 's/#undef fnmatch$$/#define fnmatch rpl_fnmatch/' \
            -e 's/#undef getline$$/#define getline rpl_getline/' \
            -e 's/#undef inline$$/#define inline __inline/' \
index 761fc3879806cf3ebdeeae66f23a454e3fa8b0bf..e4939391792c086b5f2867a90f745eb5771ddb8f 100644 (file)
@@ -2,6 +2,20 @@
 
        * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
 
+2004-11-02  Bruno Haible  <bruno@clisp.org>
+
+       * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
+       function returns void.
+
+2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
+       the includer's responsibility.
+
+2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * setenv.c: Import changes from coreutils.
+
 2003-09-08  Paul Eggert  <eggert@twinsun.com>
 
        * atexit.c (atexit): Define using a prototype.
index a7240fb9177b5e7cd7aec76beea2e96781e0c892..3ff42f279b86ec9c7c2d7b14ae62dba1bf100563 100644 (file)
 /* Prefer faster, non-thread-safe stdio functions if available.
 
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
-   This program is free software; you can redistribute it and/or modify it
-   under the terms of the GNU Library General Public License as published
-   by the Free Software Foundation; either version 2, or (at your option)
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-   USA.  */
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Written by Jim Meyering.  */
 
 #ifndef UNLOCKED_IO_H
-# define UNLOCKED_IO_H 1
+#define UNLOCKED_IO_H 1
 
-# ifndef USE_UNLOCKED_IO
-#  define USE_UNLOCKED_IO 1
-# endif
+/* These are wrappers for functions/macros from the GNU C library, and
+   from other C libraries supporting POSIX's optional thread-safe functions.
 
-# if USE_UNLOCKED_IO
-
-/* These are wrappers for functions/macros from GNU libc.
    The standard I/O functions are thread-safe.  These *_unlocked ones are
    more efficient but not thread-safe.  That they're not thread-safe is
-   fine since all of the applications in this package are single threaded.  */
-
-#  if HAVE_DECL_CLEARERR_UNLOCKED
-#   undef clearerr
-#   define clearerr(x) clearerr_unlocked (x)
-#  endif
-#  if HAVE_DECL_FEOF_UNLOCKED
-#   undef feof
-#   define feof(x) feof_unlocked (x)
-#  endif
-#  if HAVE_DECL_FERROR_UNLOCKED
-#   undef ferror
-#   define ferror(x) ferror_unlocked (x)
-#  endif
-#  if HAVE_DECL_FFLUSH_UNLOCKED
-#   undef fflush
-#   define fflush(x) fflush_unlocked (x)
-#  endif
-#  if HAVE_DECL_FGETS_UNLOCKED
-#   undef fgets
-#   define fgets(x,y,z) fgets_unlocked (x,y,z)
-#  endif
-#  if HAVE_DECL_FPUTC_UNLOCKED
-#   undef fputc
-#   define fputc(x,y) fputc_unlocked (x,y)
-#  endif
-#  if HAVE_DECL_FPUTS_UNLOCKED
-#   undef fputs
-#   define fputs(x,y) fputs_unlocked (x,y)
-#  endif
-#  if HAVE_DECL_FREAD_UNLOCKED
-#   undef fread
-#   define fread(w,x,y,z) fread_unlocked (w,x,y,z)
-#  endif
-#  if HAVE_DECL_FWRITE_UNLOCKED
-#   undef fwrite
-#   define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z)
-#  endif
-#  if HAVE_DECL_GETC_UNLOCKED
-#   undef getc
-#   define getc(x) getc_unlocked (x)
-#  endif
-#  if HAVE_DECL_GETCHAR_UNLOCKED
-#   undef getchar
-#   define getchar() getchar_unlocked ()
-#  endif
-#  if HAVE_DECL_PUTC_UNLOCKED
-#   undef putc
-#   define putc(x,y) putc_unlocked (x,y)
-#  endif
-#  if HAVE_DECL_PUTCHAR_UNLOCKED
-#   undef putchar
-#   define putchar(x) putchar_unlocked (x)
-#  endif
-
-# endif /* USE_UNLOCKED_IO */
+   fine since all of the applications in this package are single threaded.
+
+   Also, some code that is shared with the GNU C library may invoke
+   the *_unlocked functions directly.  On hosts that lack those
+   functions, invoke the non-thread-safe versions instead.  */
+
+#include <stdio.h>
+
+#if HAVE_DECL_CLEARERR_UNLOCKED
+# undef clearerr
+# define clearerr(x) clearerr_unlocked (x)
+#else
+# define clearerr_unlocked(x) clearerr (x)
+#endif
+
+#if HAVE_DECL_FEOF_UNLOCKED
+# undef feof
+# define feof(x) feof_unlocked (x)
+#else
+# define feof_unlocked(x) feof (x)
+#endif
+
+#if HAVE_DECL_FERROR_UNLOCKED
+# undef ferror
+# define ferror(x) ferror_unlocked (x)
+#else
+# define ferror_unlocked(x) ferror (x)
+#endif
+
+#if HAVE_DECL_FFLUSH_UNLOCKED
+# undef fflush
+# define fflush(x) fflush_unlocked (x)
+#else
+# define fflush_unlocked(x) fflush (x)
+#endif
+
+#if HAVE_DECL_FGETS_UNLOCKED
+# undef fgets
+# define fgets(x,y,z) fgets_unlocked (x,y,z)
+#else
+# define fgets_unlocked(x,y,z) fgets (x,y,z)
+#endif
+
+#if HAVE_DECL_FPUTC_UNLOCKED
+# undef fputc
+# define fputc(x,y) fputc_unlocked (x,y)
+#else
+# define fputc_unlocked(x,y) fputc (x,y)
+#endif
+
+#if HAVE_DECL_FPUTS_UNLOCKED
+# undef fputs
+# define fputs(x,y) fputs_unlocked (x,y)
+#else
+# define fputs_unlocked(x,y) fputs (x,y)
+#endif
+
+#if HAVE_DECL_FREAD_UNLOCKED
+# undef fread
+# define fread(w,x,y,z) fread_unlocked (w,x,y,z)
+#else
+# define fread_unlocked(w,x,y,z) fread (w,x,y,z)
+#endif
+
+#if HAVE_DECL_FWRITE_UNLOCKED
+# undef fwrite
+# define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z)
+#else
+# define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
+#endif
+
+#if HAVE_DECL_GETC_UNLOCKED
+# undef getc
+# define getc(x) getc_unlocked (x)
+#else
+# define getc_unlocked(x) getc (x)
+#endif
+
+#if HAVE_DECL_GETCHAR_UNLOCKED
+# undef getchar
+# define getchar() getchar_unlocked ()
+#else
+# define getchar_unlocked() getchar ()
+#endif
+
+#if HAVE_DECL_PUTC_UNLOCKED
+# undef putc
+# define putc(x,y) putc_unlocked (x,y)
+#else
+# define putc_unlocked(x,y) putc (x,y)
+#endif
+
+#if HAVE_DECL_PUTCHAR_UNLOCKED
+# undef putchar
+# define putchar(x) putchar_unlocked (x)
+#else
+# define putchar_unlocked(x) putchar (x)
+#endif
+
+#undef flockfile
+#define flockfile(x) ((void) 0)
+
+#undef ftrylockfile
+#define ftrylockfile(x) 0
+
+#undef funlockfile
+#define funlockfile(x) ((void) 0)
+
 #endif /* UNLOCKED_IO_H */
index ddf843a31138d62f4d702a9a4fb11efe695fb7a5..cc347fda5c079ecad76a65ffd6cc591542bdb729 100644 (file)
@@ -7,6 +7,11 @@
        * setenv.m4 (gt_FUNC_SETENV): Define VOID_UNSETENV if unsetenv()
        returns void.
 
+2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * unlocked-io.m4: Add copyright notice.
+       (gl_FUNC_GLIBC_UNLOCKED_IO): Define USE_UNLOCKED_IO.
+
 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
 
        * quotearg.m4: Fix copyright date and/or serial number.
index cd1c5f4ef7393da670629b9525f4eaa4d700fa8b..5849e4a3ae0f1769ffcb6e1ee95f3a1736039ee5 100644 (file)
@@ -1,4 +1,21 @@
-#serial 9
+# unlocked-io.m4 serial 10
+
+# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+# Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 dnl From Jim Meyering.
 dnl
@@ -10,6 +27,11 @@ dnl on Solaris 2.6).
 
 AC_DEFUN([gl_FUNC_GLIBC_UNLOCKED_IO],
 [
+  AC_DEFINE([USE_UNLOCKED_IO], 1,
+    [Define to 1 if you want getc etc. to use unlocked I/O if available.
+     Unlocked I/O can improve performance in unithreaded apps,
+     but it is not safe for multithreaded apps.])
+
   dnl Persuade glibc and Solaris <stdio.h> to declare
   dnl fgets_unlocked(), fputs_unlocked() etc.
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])