diff options
-rw-r--r-- | gettext-runtime/ChangeLog | 5 | ||||
-rw-r--r-- | gettext-runtime/Makefile.am | 4 | ||||
-rw-r--r-- | gettext-tools/ChangeLog | 5 | ||||
-rw-r--r-- | gettext-tools/Makefile.am | 4 | ||||
-rw-r--r-- | gettext-tools/lib/ChangeLog | 14 | ||||
-rw-r--r-- | gettext-tools/lib/unlocked-io.h | 193 | ||||
-rw-r--r-- | gettext-tools/m4/ChangeLog | 5 | ||||
-rw-r--r-- | gettext-tools/m4/unlocked-io.m4 | 24 |
8 files changed, 178 insertions, 76 deletions
diff --git a/gettext-runtime/ChangeLog b/gettext-runtime/ChangeLog index 0f79421..a3dd08f 100644 --- a/gettext-runtime/ChangeLog +++ b/gettext-runtime/ChangeLog @@ -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. diff --git a/gettext-runtime/Makefile.am b/gettext-runtime/Makefile.am index f2be209..f0db51e 100644 --- a/gettext-runtime/Makefile.am +++ b/gettext-runtime/Makefile.am @@ -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/' \ diff --git a/gettext-tools/ChangeLog b/gettext-tools/ChangeLog index b06aaf8..01979c9 100644 --- a/gettext-tools/ChangeLog +++ b/gettext-tools/ChangeLog @@ -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. diff --git a/gettext-tools/Makefile.am b/gettext-tools/Makefile.am index b65a02f..3b2d1bb 100644 --- a/gettext-tools/Makefile.am +++ b/gettext-tools/Makefile.am @@ -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/' \ diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index 761fc38..e493939 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -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. diff --git a/gettext-tools/lib/unlocked-io.h b/gettext-tools/lib/unlocked-io.h index a7240fb..3ff42f2 100644 --- a/gettext-tools/lib/unlocked-io.h +++ b/gettext-tools/lib/unlocked-io.h @@ -1,90 +1,137 @@ /* 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 */ diff --git a/gettext-tools/m4/ChangeLog b/gettext-tools/m4/ChangeLog index ddf843a..cc347fd 100644 --- a/gettext-tools/m4/ChangeLog +++ b/gettext-tools/m4/ChangeLog @@ -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. diff --git a/gettext-tools/m4/unlocked-io.m4 b/gettext-tools/m4/unlocked-io.m4 index cd1c5f4..5849e4a 100644 --- a/gettext-tools/m4/unlocked-io.m4 +++ b/gettext-tools/m4/unlocked-io.m4 @@ -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]) |