]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Avoid using *_unlocked functions on Solaris 2.5.1.
authorBruno Haible <bruno@clisp.org>
Fri, 27 Jun 2003 12:24:42 +0000 (12:24 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:10:45 +0000 (12:10 +0200)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/localcharset.c
gettext-runtime/intl/localealias.c
gettext-runtime/m4/ChangeLog
gettext-runtime/m4/gettext.m4

index fba6286699706b200da64f5048d9900dc107f9bc..076bf19c0f93100ba60cc33adbc0cfdcc2f11202 100644 (file)
@@ -1,3 +1,10 @@
+2003-06-27  Bruno Haible  <bruno@clisp.org>
+
+       Avoid use of *_unlocked functions on Solaris 2.5.1.
+       * localcharset.c: Test HAVE_DECL_GETC_UNLOCKED, not HAVE_GETC_UNLOCKED.
+       * localealias.c: Test HAVE_DECL_*_UNLOCKED, not HAVE_*_UNLOCKED.
+       Reported by Eric Botcazou <ebotcazou@libertysurf.fr>.
+
 2003-06-22  Bruno Haible  <bruno@clisp.org>
 
        Portability to mingw32.
index d04d05368f96b53fa19b61ea254dee638920a69c..4865f1037a06f09c76a35fd3060c55359e95790e 100644 (file)
@@ -86,7 +86,7 @@
 # define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
 #endif
 
-#ifdef HAVE_GETC_UNLOCKED
+#if HAVE_DECL_GETC_UNLOCKED
 # undef getc
 # define getc getc_unlocked
 #endif
index 7c4ce58f2a67ee15e50113a77d1a68dc6452b4c1..bef434f1fd3ca4a0d6632d23cce0e50b6e1b27bf 100644 (file)
@@ -110,11 +110,11 @@ __libc_lock_define_initialized (static, lock);
 # define freea(p) free (p)
 #endif
 
-#if defined _LIBC_REENTRANT || defined HAVE_FGETS_UNLOCKED
+#if defined _LIBC_REENTRANT || HAVE_DECL_FGETS_UNLOCKED
 # undef fgets
 # define fgets(buf, len, s) fgets_unlocked (buf, len, s)
 #endif
-#if defined _LIBC_REENTRANT || defined HAVE_FEOF_UNLOCKED
+#if defined _LIBC_REENTRANT || HAVE_DECL_FEOF_UNLOCKED
 # undef feof
 # define feof(s) feof_unlocked (s)
 #endif
index 3ef0b9c5ab90168cd74902ad851581c9a20c9551..09ef097253af71cac053051d65687cbf5c0f3f67 100644 (file)
@@ -1,3 +1,12 @@
+2003-06-27  Bruno Haible  <bruno@clisp.org>
+
+       Avoid use of *_unlocked functions on Solaris 2.5.1.
+       * gettext.m4 (AM_INTL_SUBDIR): Don't test for the functions
+       feof_unlocked, fgets_unlocked, getc_unlocked. Test for their
+       declaration instead.
+       (gt_CHECK_DECL): New macro.
+       Reported by Eric Botcazou <ebotcazou@libertysurf.fr>.
+
 2003-06-19  Bruno Haible  <bruno@clisp.org>
 
        * printf-posix.m4: New file.
index 1bf54ff0dc0815dd5cddbcc02509310d73ad22e9..5af807ec8ed302bac53303e9eb782eea859459db 100644 (file)
@@ -1,4 +1,4 @@
-# gettext.m4 serial 21 (gettext-0.12.2)
+# gettext.m4 serial 22 (gettext-0.12.2)
 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
@@ -377,10 +377,18 @@ AC_DEFUN([AM_INTL_SUBDIR],
   AC_CHECK_TYPES([ptrdiff_t])
   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
 stdlib.h string.h unistd.h sys/param.h])
-  AC_CHECK_FUNCS([asprintf feof_unlocked fgets_unlocked getc_unlocked getcwd \
-getegid geteuid getgid getuid mempcpy munmap putenv setenv setlocale snprintf \
-stpcpy strcasecmp strdup strtoul tsearch wprintf __argz_count \
-__argz_stringify __argz_next __fsetlocking])
+  AC_CHECK_FUNCS([asprintf getcwd getegid geteuid getgid getuid mempcpy \
+munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup strtoul \
+tsearch wprintf __argz_count __argz_stringify __argz_next __fsetlocking])
+
+  dnl Use the *_unlocked functions only if they are declared.
+  dnl (because some of them were declared in Solaris 2.5.1 but were removed
+  dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run
+  dnl on Solaris 2.6).
+  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
+  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
+  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
+  gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
 
   case $gt_cv_func_printf_posix in
     *yes) HAVE_POSIX_PRINTF=1 ;;
@@ -445,5 +453,25 @@ changequote([,])dnl
 ])
 
 
+dnl gt_CHECK_DECL(FUNC, INCLUDES)
+dnl Check whether a function is declared.
+AC_DEFUN([gt_CHECK_DECL],
+[
+  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
+    [AC_TRY_COMPILE([$2], [
+#ifndef $1
+  char *p = (char *) $1;
+#endif
+], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
+  if test $ac_cv_have_decl_$1 = yes; then
+    gt_value=1
+  else
+    gt_value=0
+  fi
+  AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
+    [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
+])
+
+
 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])