diff --git a/ChangeLog b/ChangeLog index 477753d197d..3e48bfa5a67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-07-09 Paul Eggert + + Add strtoimax module, needed for Solaris 8 port. + * Makefile.in (GNULIB_MODULES): Add strtoimax. + * lib/strtoll.c, m4/strtoimax.m4, m4/strtoll.m4: New files, + automatically imported from gnulib. + * lib/gnulib.mk, m4/gl-comp.m4: Regenerate. + 2011-07-08 Paul Eggert Add gnulib support for pthread_sigmask (Bug#9010). diff --git a/Makefile.in b/Makefile.in index a3d85bad22a..ce7f3f1a3d8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -337,7 +337,7 @@ GNULIB_MODULES = \ dup2 \ filemode getloadavg getopt-gnu ignore-value intprops lstat \ mktime pthread_sigmask readlink \ - socklen stdarg stdio strftime strtoumax symlink sys_stat + socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat GNULIB_TOOL_FLAGS = \ --conditional-dependencies --import --no-changelog --no-vc-files \ --makefile-name=gnulib.mk diff --git a/lib/gnulib.mk b/lib/gnulib.mk index 25647f0399c..4341a5d184d 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk @@ -9,7 +9,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dup2 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime pthread_sigmask readlink socklen stdarg stdio strftime strtoumax symlink sys_stat +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dup2 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime pthread_sigmask readlink socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat MOSTLYCLEANFILES += core *.stackdump @@ -726,6 +726,26 @@ EXTRA_DIST += strftime.h ## end gnulib module strftime +## begin gnulib module strtoimax + + +EXTRA_DIST += strtoimax.c + +EXTRA_libgnu_a_SOURCES += strtoimax.c + +## end gnulib module strtoimax + +## begin gnulib module strtoll + +if gl_GNULIB_ENABLED_strtoll + +endif +EXTRA_DIST += strtol.c strtoll.c + +EXTRA_libgnu_a_SOURCES += strtol.c strtoll.c + +## end gnulib module strtoll + ## begin gnulib module strtoull if gl_GNULIB_ENABLED_strtoull diff --git a/lib/strtoll.c b/lib/strtoll.c new file mode 100644 index 00000000000..75afa4d9bc9 --- /dev/null +++ b/lib/strtoll.c @@ -0,0 +1,33 @@ +/* Function to parse a `long long int' from text. + Copyright (C) 1995-1997, 1999, 2001, 2009-2011 Free Software Foundation, + Inc. + This file is part of the GNU C Library. + + 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 3 of the License, 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, see . */ + +#define QUAD 1 + +#include + +#ifdef _LIBC +# ifdef SHARED +# include + +# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2) +compat_symbol (libc, __strtoll_internal, __strtoq_internal, GLIBC_2_0); +# endif + +# endif +weak_alias (strtoll, strtoq) +#endif diff --git a/m4/gl-comp.m4 b/m4/gl-comp.m4 index 6c94e373871..8370c571655 100644 --- a/m4/gl-comp.m4 +++ b/m4/gl-comp.m4 @@ -71,6 +71,8 @@ AC_DEFUN([gl_EARLY], # Code from module stdio: # Code from module stdlib: # Code from module strftime: + # Code from module strtoimax: + # Code from module strtoll: # Code from module strtoull: # Code from module strtoumax: # Code from module symlink: @@ -164,6 +166,12 @@ gl_STDINT_H gl_STDIO_H gl_STDLIB_H gl_FUNC_GNU_STRFTIME +gl_FUNC_STRTOIMAX +if test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no; then + AC_LIBOBJ([strtoimax]) + gl_PREREQ_STRTOIMAX +fi +gl_INTTYPES_MODULE_INDICATOR([strtoimax]) gl_FUNC_STRTOUMAX if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no; then AC_LIBOBJ([strtoumax]) @@ -190,6 +198,7 @@ gl_UNISTD_H gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false gl_gnulib_enabled_sigprocmask=false gl_gnulib_enabled_stat=false + gl_gnulib_enabled_strtoll=false gl_gnulib_enabled_strtoull=false gl_gnulib_enabled_verify=false func_gl_gnulib_m4code_dosname () @@ -236,6 +245,18 @@ gl_SYS_STAT_MODULE_INDICATOR([stat]) fi fi } + func_gl_gnulib_m4code_strtoll () + { + if ! $gl_gnulib_enabled_strtoll; then +gl_FUNC_STRTOLL +if test $HAVE_STRTOLL = 0; then + AC_LIBOBJ([strtoll]) + gl_PREREQ_STRTOLL +fi +gl_STDLIB_MODULE_INDICATOR([strtoll]) + gl_gnulib_enabled_strtoll=true + fi + } func_gl_gnulib_m4code_strtoull () { if ! $gl_gnulib_enabled_strtoull; then @@ -269,6 +290,12 @@ gl_STDLIB_MODULE_INDICATOR([strtoull]) if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then func_gl_gnulib_m4code_stat fi + if test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no; then + func_gl_gnulib_m4code_verify + fi + if test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no && test $ac_cv_type_long_long_int = yes; then + func_gl_gnulib_m4code_strtoll + fi if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no; then func_gl_gnulib_m4code_verify fi @@ -280,6 +307,7 @@ gl_STDLIB_MODULE_INDICATOR([strtoull]) AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36]) AM_CONDITIONAL([gl_GNULIB_ENABLED_sigprocmask], [$gl_gnulib_enabled_sigprocmask]) AM_CONDITIONAL([gl_GNULIB_ENABLED_stat], [$gl_gnulib_enabled_stat]) + AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll]) AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoull], [$gl_gnulib_enabled_strtoull]) AM_CONDITIONAL([gl_GNULIB_ENABLED_verify], [$gl_gnulib_enabled_verify]) # End of code from modules @@ -473,6 +501,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/strftime.h lib/strtoimax.c lib/strtol.c + lib/strtoll.c lib/strtoul.c lib/strtoull.c lib/strtoumax.c @@ -517,6 +546,8 @@ AC_DEFUN([gl_FILE_LIST], [ m4/stdio_h.m4 m4/stdlib_h.m4 m4/strftime.m4 + m4/strtoimax.m4 + m4/strtoll.m4 m4/strtoull.m4 m4/strtoumax.m4 m4/symlink.m4 diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4 new file mode 100644 index 00000000000..47fb1bc9c38 --- /dev/null +++ b/m4/strtoimax.m4 @@ -0,0 +1,23 @@ +# strtoimax.m4 serial 10 +dnl Copyright (C) 2002-2004, 2006, 2009-2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRTOIMAX], +[ + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) + + AC_CHECK_DECLS_ONCE([strtoimax]) + if test "$ac_cv_have_decl_strtoimax" != yes; then + HAVE_DECL_STRTOIMAX=0 + + AC_CHECK_FUNCS([strtoimax]) + fi +]) + +# Prerequisites of lib/strtoimax.c. +AC_DEFUN([gl_PREREQ_STRTOIMAX], [ + AC_CHECK_DECLS([strtoll]) + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) +]) diff --git a/m4/strtoll.m4 b/m4/strtoll.m4 new file mode 100644 index 00000000000..ed6a854b58c --- /dev/null +++ b/m4/strtoll.m4 @@ -0,0 +1,24 @@ +# strtoll.m4 serial 7 +dnl Copyright (C) 2002, 2004, 2006, 2008-2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRTOLL], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + dnl We don't need (and can't compile) the replacement strtoll + dnl unless the type 'long long int' exists. + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + if test "$ac_cv_type_long_long_int" = yes; then + AC_CHECK_FUNCS([strtoll]) + if test $ac_cv_func_strtoll = no; then + HAVE_STRTOLL=0 + fi + fi +]) + +# Prerequisites of lib/strtoll.c. +AC_DEFUN([gl_PREREQ_STRTOLL], [ + : +])