summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2006-10-21 09:56:40 +0000
committerSimon Josefsson <simon@josefsson.org>2006-10-21 09:56:40 +0000
commit88737f5d01172764cbfd26d7a778603bcf61ccda (patch)
tree5c171f586a09dfe768b91af6b8ba49f3f5a954e4
parenta26afd5bdeeb76bb2160e56010728167b43466d6 (diff)
downloadgnutls-88737f5d01172764cbfd26d7a778603bcf61ccda.tar.gz
Update.
-rw-r--r--gl/Makefile.am173
-rw-r--r--gl/gettext.h30
-rw-r--r--gl/m4/alloca.m425
-rw-r--r--gl/m4/gnulib-comp.m431
-rw-r--r--gl/m4/lock.m458
-rw-r--r--gl/m4/longlong.m46
-rw-r--r--gl/m4/size_max.m470
-rw-r--r--gl/m4/stdint.m411
-rw-r--r--gl/m4/ulonglong.m47
-rw-r--r--gl/m4/vasnprintf.m410
-rw-r--r--gl/printf-args.c4
-rw-r--r--gl/printf-args.h10
-rw-r--r--gl/printf-parse.c15
-rw-r--r--gl/stdint_.h68
-rw-r--r--gl/strdup.c4
-rw-r--r--gl/vasnprintf.c12
16 files changed, 367 insertions, 167 deletions
diff --git a/gl/Makefile.am b/gl/Makefile.am
index f5006d0d5c..f810ec848d 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -1,3 +1,4 @@
+## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
# Copyright (C) 2004-2006 Free Software Foundation, Inc.
#
@@ -15,7 +16,8 @@ AUTOMAKE_OPTIONS = 1.5 gnits
noinst_LTLIBRARIES = libgnu.la
libgnu_la_SOURCES =
-libgnu_la_LIBADD = $(LTLIBOBJS)
+libgnu_la_LIBADD = $(gl_LTLIBOBJS)
+libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
libgnu_la_LDFLAGS = $(AM_LDFLAGS)
noinst_HEADERS =
EXTRA_DIST =
@@ -32,15 +34,18 @@ AM_CPPFLAGS =
## begin gnulib module alloca-opt
BUILT_SOURCES += $(ALLOCA_H)
-EXTRA_DIST += alloca_.h
# We need the following in order to create <alloca.h> when the system
# doesn't have one that works with the given compiler.
alloca.h: alloca_.h
- cp -f $(srcdir)/alloca_.h $@-t
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/alloca_.h; \
+ } > $@-t
mv -f $@-t $@
MOSTLYCLEANFILES += alloca.h alloca.h-t
+EXTRA_DIST += alloca_.h
+
## end gnulib module alloca-opt
## begin gnulib module arpa_inet
@@ -52,7 +57,9 @@ BUILT_SOURCES += $(ARPA_INET_H)
arpa/inet.h:
test -d arpa || mkdir arpa
rm -f $@-t $@
- echo '#include <sys/socket.h>' >$@-t
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ echo '#include <sys/socket.h>'; \
+ } > $@-t
mv $@-t $@
MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
MOSTLYCLEANDIRS += arpa
@@ -61,40 +68,53 @@ MOSTLYCLEANDIRS += arpa
## begin gnulib module gc
-EXTRA_DIST += gc.h
if GL_COND_LIBTOOL
libgnu_la_LDFLAGS += $(LTLIBGCRYPT)
endif
+EXTRA_DIST += gc-gnulib.c gc-libgcrypt.c gc.h
+
## end gnulib module gc
## begin gnulib module gc-arcfour
-EXTRA_DIST += arcfour.h
+
+EXTRA_DIST += arcfour.c arcfour.h
## end gnulib module gc-arcfour
+## begin gnulib module gc-arctwo
+
+
+EXTRA_DIST += arctwo.c arctwo.h
+
+## end gnulib module gc-arctwo
+
## begin gnulib module gc-des
-EXTRA_DIST += des.h
+
+EXTRA_DIST += des.c des.h
## end gnulib module gc-des
## begin gnulib module gc-hmac-md5
-EXTRA_DIST += memxor.h hmac.h md5.h
+
+EXTRA_DIST += hmac-md5.c hmac.h md5.c md5.h memxor.c memxor.h
## end gnulib module gc-hmac-md5
## begin gnulib module gc-hmac-sha1
-EXTRA_DIST += memxor.h hmac.h sha1.h
+
+EXTRA_DIST += hmac-sha1.c hmac.h memxor.c memxor.h sha1.c sha1.h
## end gnulib module gc-hmac-sha1
## begin gnulib module gc-md4
-EXTRA_DIST += md4.h
+
+EXTRA_DIST += md4.c md4.h
## end gnulib module gc-md4
@@ -102,35 +122,56 @@ EXTRA_DIST += md4.h
libgnu_la_SOURCES += md5.h
+EXTRA_DIST += md5.c
+
## end gnulib module gc-md5
+## begin gnulib module gc-pbkdf2-sha1
+
+
+EXTRA_DIST += gc-pbkdf2-sha1.c
+
+## end gnulib module gc-pbkdf2-sha1
+
+## begin gnulib module gc-rijndael
+
+
+EXTRA_DIST += rijndael-alg-fst.c rijndael-alg-fst.h rijndael-api-fst.c rijndael-api-fst.h
+
+## end gnulib module gc-rijndael
+
## begin gnulib module gc-sha1
-EXTRA_DIST += sha1.h
+
+EXTRA_DIST += sha1.c sha1.h
## end gnulib module gc-sha1
## begin gnulib module getaddrinfo
-libgnu_la_SOURCES += getaddrinfo.h
+
+EXTRA_DIST += gai_strerror.c getaddrinfo.c getaddrinfo.h
## end gnulib module getaddrinfo
## begin gnulib module getdelim
-EXTRA_DIST += getdelim.h
+
+EXTRA_DIST += getdelim.c getdelim.h
## end gnulib module getdelim
## begin gnulib module getline
-EXTRA_DIST += getline.h
+
+EXTRA_DIST += getline.c getline.h
## end gnulib module getline
## begin gnulib module getpass
-EXTRA_DIST += getpass.h
+
+EXTRA_DIST += getpass.c getpass.h
## end gnulib module getpass
@@ -156,28 +197,39 @@ libgnu_la_SOURCES += gettext.h
## begin gnulib module inet_ntop
-libgnu_la_SOURCES += inet_ntop.h
+
+EXTRA_DIST += inet_ntop.c inet_ntop.h
## end gnulib module inet_ntop
## begin gnulib module inet_pton
-libgnu_la_SOURCES += inet_pton.h
+
+EXTRA_DIST += inet_pton.c inet_pton.h
## end gnulib module inet_pton
## begin gnulib module md2
-EXTRA_DIST += md2.h
+
+EXTRA_DIST += md2.c md2.h
## end gnulib module md2
## begin gnulib module memmem
-libgnu_la_SOURCES += memmem.h
+
+EXTRA_DIST += memmem.c memmem.h
## end gnulib module memmem
+## begin gnulib module memmove
+
+
+EXTRA_DIST += memmove.c
+
+## end gnulib module memmove
+
## begin gnulib module minmax
libgnu_la_SOURCES += minmax.h
@@ -193,7 +245,9 @@ BUILT_SOURCES += $(NETINET_IN_H)
netinet/in.h:
test -d netinet || mkdir netinet
rm -f $@-t $@
- echo '#include <sys/socket.h>' >$@-t
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ echo '#include <sys/socket.h>'; \
+ } > $@-t
mv $@-t $@
MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
MOSTLYCLEANDIRS += netinet
@@ -202,13 +256,15 @@ MOSTLYCLEANDIRS += netinet
## begin gnulib module read-file
-EXTRA_DIST += read-file.h
+
+EXTRA_DIST += read-file.c read-file.h
## end gnulib module read-file
## begin gnulib module readline
-EXTRA_DIST += readline.h
+
+EXTRA_DIST += readline.c readline.h
## end gnulib module readline
@@ -220,86 +276,99 @@ libgnu_la_SOURCES += size_max.h
## begin gnulib module snprintf
-libgnu_la_SOURCES += snprintf.h
+
+EXTRA_DIST += snprintf.c snprintf.h
## end gnulib module snprintf
## begin gnulib module stdbool
BUILT_SOURCES += $(STDBOOL_H)
-EXTRA_DIST += stdbool_.h
# We need the following in order to create <stdbool.h> when the system
# doesn't have one that works.
stdbool.h: stdbool_.h
rm -f $@-t $@
- sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h > $@-t
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h; \
+ } > $@-t
mv $@-t $@
MOSTLYCLEANFILES += stdbool.h stdbool.h-t
+EXTRA_DIST += stdbool_.h
+
## end gnulib module stdbool
## begin gnulib module stdint
BUILT_SOURCES += $(STDINT_H)
-EXTRA_DIST += stdint_.h
# We need the following in order to create <stdint.h> when the system
# doesn't have one that works with the given compiler.
stdint.h: stdint_.h
rm -f $@-t $@
- sed -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
- -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
- -e 's|@''ABSOLUTE_STDINT_H''@|$(ABSOLUTE_STDINT_H)|g' \
- -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
- -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
- -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
- -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
- -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
- -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
- -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
- -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
- -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
- -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
- -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
- -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
- -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
- -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
- -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
- -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
- -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
- -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
- < $(srcdir)/stdint_.h > $@-t
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
+ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+ -e 's|@''ABSOLUTE_STDINT_H''@|$(ABSOLUTE_STDINT_H)|g' \
+ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
+ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
+ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
+ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
+ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
+ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
+ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
+ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
+ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
+ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
+ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
+ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
+ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
+ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
+ < $(srcdir)/stdint_.h; \
+ } > $@-t
mv $@-t $@
MOSTLYCLEANFILES += stdint.h stdint.h-t
+EXTRA_DIST += stdint_.h
+
## end gnulib module stdint
## begin gnulib module strdup
-EXTRA_DIST += strdup.h
+
+EXTRA_DIST += strdup.c strdup.h
## end gnulib module strdup
## begin gnulib module sys_socket
BUILT_SOURCES += $(SYS_SOCKET_H)
-EXTRA_DIST += socket_.h
# We need the following in order to create <sys/socket.h> when the system
# doesn't have one that works with the given compiler.
sys/socket.h: socket_.h
test -d sys || mkdir sys
- cp -f $(srcdir)/socket_.h $@-t
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/socket_.h; \
+ } > $@-t
mv -f $@-t $@
MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
MOSTLYCLEANDIRS += sys
+EXTRA_DIST += socket_.h
+
## end gnulib module sys_socket
## begin gnulib module vasnprintf
-libgnu_la_SOURCES += printf-args.h printf-parse.h vasnprintf.h
+
+EXTRA_DIST += asnprintf.c printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
## end gnulib module vasnprintf
diff --git a/gl/gettext.h b/gl/gettext.h
index 7a1430c7a4..f7fd6a5e10 100644
--- a/gl/gettext.h
+++ b/gl/gettext.h
@@ -24,6 +24,18 @@
/* Get declarations of GNU message catalog functions. */
# include <libintl.h>
+/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
+ the gettext() and ngettext() macros. This is an alternative to calling
+ textdomain(), and is useful for libraries. */
+# ifdef DEFAULT_TEXT_DOMAIN
+# undef gettext
+# define gettext(Msgid) \
+ dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
+# undef ngettext
+# define ngettext(Msgid1, Msgid2, N) \
+ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
+# endif
+
#else
/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
@@ -82,14 +94,24 @@
MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
short and rarely need to change.
The letter 'p' stands for 'particular' or 'special'. */
-#define pgettext(Msgctxt, Msgid) \
- pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#ifdef DEFAULT_TEXT_DOMAIN
+# define pgettext(Msgctxt, Msgid) \
+ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#else
+# define pgettext(Msgctxt, Msgid) \
+ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#endif
#define dpgettext(Domainname, Msgctxt, Msgid) \
pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
-#define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
- npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#ifdef DEFAULT_TEXT_DOMAIN
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#else
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#endif
#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
diff --git a/gl/m4/alloca.m4 b/gl/m4/alloca.m4
index a9e3f452c9..3e70d12a7c 100644
--- a/gl/m4/alloca.m4
+++ b/gl/m4/alloca.m4
@@ -1,5 +1,5 @@
-# alloca.m4 serial 5
-dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# alloca.m4 serial 6
+dnl Copyright (C) 2002-2004, 2006 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.
@@ -17,16 +17,21 @@ AC_DEFUN([gl_FUNC_ALLOCA],
# Define an additional variable used in the Makefile substitution.
if test $ac_cv_working_alloca_h = yes; then
- AC_EGREP_CPP([Need own alloca], [
+ AC_CACHE_VAL([gl_cv_rpl_alloca], [
+ AC_EGREP_CPP([Need own alloca], [
#if defined __GNUC__ || defined _AIX || defined _MSC_VER
- Need own alloca
+ Need own alloca
#endif
- ],
- [AC_DEFINE(HAVE_ALLOCA, 1,
- [Define to 1 if you have `alloca' after including <alloca.h>,
- a header that may be supplied by this distribution.])
- ALLOCA_H=alloca.h],
- [ALLOCA_H=])
+ ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no])
+ ])
+ if test $gl_cv_rpl_alloca = yes; then
+ AC_DEFINE([HAVE_ALLOCA], 1,
+ [Define to 1 if you have `alloca' after including <alloca.h>,
+ a header that may be supplied by this distribution.])
+ ALLOCA_H=alloca.h
+ else
+ ALLOCA_H=
+ fi
else
ALLOCA_H=alloca.h
fi
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index c47206c36c..c3c7ea7f74 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -1,3 +1,4 @@
+# DO NOT EDIT! GENERATED AUTOMATICALLY!
# Copyright (C) 2004-2006 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
@@ -21,6 +22,8 @@ AC_DEFUN([gl_EARLY],
[
m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace
m4_pattern_allow([^gl_ES$])dnl a valid locale name
+ m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
+ m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
AC_REQUIRE([AC_PROG_RANLIB])
AC_REQUIRE([AC_GNU_SOURCE])
AC_REQUIRE([gl_LOCK_EARLY])
@@ -30,6 +33,8 @@ AC_DEFUN([gl_EARLY],
# "Check for header files, types and library functions".
AC_DEFUN([gl_INIT],
[
+ m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
+ m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
AM_CONDITIONAL([GL_COND_LIBTOOL], [true])
gl_cond_libtool=true
gl_source_base='gl'
@@ -76,8 +81,34 @@ AC_DEFUN([gl_INIT],
gl_HEADER_SYS_SOCKET
gl_FUNC_VASNPRINTF
gl_XSIZE
+ m4_popdef([AC_REPLACE_FUNCS])
+ m4_popdef([AC_LIBOBJ])
+ AC_CONFIG_COMMANDS_PRE([
+ gl_libobjs=
+ gl_ltlibobjs=
+ if test -n "$gl_LIBOBJS"; then
+ # Remove the extension.
+ sed_drop_objext='s/\.o$//;s/\.obj$//'
+ for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
+ gl_libobjs="$gl_libobjs $i.$ac_objext"
+ gl_ltlibobjs="$gl_ltlibobjs $i.lo"
+ done
+ fi
+ AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
+ AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
+ ])
])
+# Like AC_LIBOBJ, except that the module name goes
+# into gl_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gl_LIBOBJ],
+ [gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"])
+
+# Like AC_REPLACE_FUNCS, except that the module name goes
+# into gl_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gl_REPLACE_FUNCS],
+ [AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])])
+
# This macro records the list of files which have been installed by
# gnulib-tool and may be removed by future gnulib-tool invocations.
AC_DEFUN([gl_FILE_LIST], [
diff --git a/gl/m4/lock.m4 b/gl/m4/lock.m4
index 94c1870daf..e031415851 100644
--- a/gl/m4/lock.m4
+++ b/gl/m4/lock.m4
@@ -1,4 +1,4 @@
-# lock.m4 serial 5 (gettext-0.15.1)
+# lock.m4 serial 6 (gettext-0.15.1)
dnl Copyright (C) 2005-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -21,12 +21,12 @@ dnl multithread-safe programs.
AC_DEFUN([gl_LOCK_EARLY],
[
- AC_REQUIRE([gl_LOCK_BODY])
+ AC_REQUIRE([gl_LOCK_EARLY_BODY])
])
dnl The guts of gl_LOCK_EARLY. Needs to be expanded only once.
-AC_DEFUN([gl_LOCK_BODY],
+AC_DEFUN([gl_LOCK_EARLY_BODY],
[
dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
dnl influences the result of the autoconf tests that test for *_unlocked
@@ -49,6 +49,34 @@ AC_HELP_STRING([--disable-threads], [build without multithread safety]),
*) gl_use_threads=yes ;;
esac
])
+ if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+ # For using <pthread.h>:
+ case "$host_os" in
+ osf*)
+ # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+ # groks <pthread.h>. cc also understands the flag -pthread, but
+ # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+ # 2. putting a flag into CPPFLAGS that has an effect on the linker
+ # causes the AC_TRY_LINK test below to succeed unexpectedly,
+ # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+ CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+ ;;
+ esac
+ # Some systems optimize for single-threaded programs by default, and
+ # need special flags to disable these optimizations. For example, the
+ # definition of 'errno' in <errno.h>.
+ case "$host_os" in
+ aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
+ solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
+ esac
+ fi
+])
+
+dnl The guts of gl_LOCK. Needs to be expanded only once.
+
+AC_DEFUN([gl_LOCK_BODY],
+[
+ AC_REQUIRE([gl_LOCK_EARLY_BODY])
gl_threads_api=none
LIBTHREAD=
LTLIBTHREAD=
@@ -63,26 +91,12 @@ AC_HELP_STRING([--disable-threads], [build without multithread safety]),
AC_MSG_RESULT([$gl_have_weak])
if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
# On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
- # it groks <pthread.h>.
- gl_save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+ # it groks <pthread.h>. It's added above, in gl_LOCK_EARLY_BODY.
AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no)
- CPPFLAGS="$gl_save_CPPFLAGS"
if test "$gl_have_pthread_h" = yes; then
# Other possible tests:
# -lpthreads (FSU threads, PCthreads)
# -lgthreads
- case "$host_os" in
- osf*)
- # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
- # groks <pthread.h>. cc also understands the flag -pthread, but
- # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
- # 2. putting a flag into CPPFLAGS that has an effect on the linker
- # causes the AC_TRY_LINK test below to succeed unexpectedly,
- # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
- CPPFLAGS="$CPPFLAGS -D_REENTRANT"
- ;;
- esac
gl_have_pthread=
# Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
# in libc. IRIX 6.5 has the first one in both libc and libpthread, but
@@ -151,13 +165,6 @@ return !x;
#endif],
[AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1,
[Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
- # Some systems optimize for single-threaded programs by default, and
- # need special flags to disable these optimizations. For example, the
- # definition of 'errno' in <errno.h>.
- case "$host_os" in
- aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
- solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
- esac
fi
fi
fi
@@ -241,6 +248,7 @@ return !x;
AC_DEFUN([gl_LOCK],
[
AC_REQUIRE([gl_LOCK_EARLY])
+ AC_REQUIRE([gl_LOCK_BODY])
gl_PREREQ_LOCK
])
diff --git a/gl/m4/longlong.m4 b/gl/m4/longlong.m4
index 89a47bd195..3716c09f6c 100644
--- a/gl/m4/longlong.m4
+++ b/gl/m4/longlong.m4
@@ -1,4 +1,4 @@
-# longlong.m4 serial 7
+# longlong.m4 serial 8
dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,6 +10,10 @@ dnl From Paul Eggert.
# This fixes a bug in Autoconf 2.60, but can be removed once we
# assume 2.61 everywhere.
+# Note: If the type 'long long int' exists but is only 32 bits large
+# (as on some very old compilers), AC_TYPE_LONG_LONG_INT will not be
+# defined. In this case you can treat 'long long int' like 'long int'.
+
AC_DEFUN([AC_TYPE_LONG_LONG_INT],
[
AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
diff --git a/gl/m4/size_max.m4 b/gl/m4/size_max.m4
index 029e471950..bfba811eb6 100644
--- a/gl/m4/size_max.m4
+++ b/gl/m4/size_max.m4
@@ -1,4 +1,4 @@
-# size_max.m4 serial 4
+# size_max.m4 serial 5
dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -11,8 +11,9 @@ AC_DEFUN([gl_SIZE_MAX],
AC_CHECK_HEADERS(stdint.h)
dnl First test whether the system already has SIZE_MAX.
AC_MSG_CHECKING([for SIZE_MAX])
- result=
- AC_EGREP_CPP([Found it], [
+ AC_CACHE_VAL([gl_cv_size_max], [
+ gl_cv_size_max=
+ AC_EGREP_CPP([Found it], [
#include <limits.h>
#if HAVE_STDINT_H
#include <stdint.h>
@@ -20,41 +21,42 @@ AC_DEFUN([gl_SIZE_MAX],
#ifdef SIZE_MAX
Found it
#endif
-], result=yes)
- if test -z "$result"; then
- dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
- dnl than the type 'unsigned long'. Try hard to find a definition that can
- dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
- _AC_COMPUTE_INT([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1,
- [#include <stddef.h>
+], gl_cv_size_max=yes)
+ if test -z "$gl_cv_size_max"; then
+ dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
+ dnl than the type 'unsigned long'. Try hard to find a definition that can
+ dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
+ _AC_COMPUTE_INT([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1,
+ [#include <stddef.h>
#include <limits.h>], size_t_bits_minus_1=)
- _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
- [#include <stddef.h>], fits_in_uint=)
- if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
- if test $fits_in_uint = 1; then
- dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
- dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
- AC_TRY_COMPILE([#include <stddef.h>
- extern size_t foo;
- extern unsigned long foo;
- ], [], fits_in_uint=0)
- fi
- dnl We cannot use 'expr' to simplify this expression, because 'expr'
- dnl works only with 'long' integers in the host environment, while we
- dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
- if test $fits_in_uint = 1; then
- result="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
+ _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
+ [#include <stddef.h>], fits_in_uint=)
+ if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
+ if test $fits_in_uint = 1; then
+ dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
+ dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
+ AC_TRY_COMPILE([#include <stddef.h>
+ extern size_t foo;
+ extern unsigned long foo;
+ ], [], fits_in_uint=0)
+ fi
+ dnl We cannot use 'expr' to simplify this expression, because 'expr'
+ dnl works only with 'long' integers in the host environment, while we
+ dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
+ if test $fits_in_uint = 1; then
+ gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
+ else
+ gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
+ fi
else
- result="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
+ dnl Shouldn't happen, but who knows...
+ gl_cv_size_max='((size_t)~(size_t)0)'
fi
- else
- dnl Shouldn't happen, but who knows...
- result='((size_t)~(size_t)0)'
fi
- fi
- AC_MSG_RESULT([$result])
- if test "$result" != yes; then
- AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
+ ])
+ AC_MSG_RESULT([$gl_cv_size_max])
+ if test "$gl_cv_size_max" != yes; then
+ AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
[Define as the maximum value of type 'size_t', if the system doesn't define it.])
fi
])
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index 48748c6139..9261def3bb 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 18
+# stdint.m4 serial 19
dnl Copyright (C) 2001-2002, 2004-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,7 @@ AC_DEFUN([gl_STDINT_H],
[
AC_PREREQ(2.59)dnl
- dnl Check for long long int.
+ dnl Check for long long int and unsigned long long int.
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
if test $ac_cv_type_long_long_int = yes; then
HAVE_LONG_LONG_INT=1
@@ -19,6 +19,13 @@ AC_DEFUN([gl_STDINT_H],
HAVE_LONG_LONG_INT=0
fi
AC_SUBST([HAVE_LONG_LONG_INT])
+ AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
+ if test $ac_cv_type_unsigned_long_long_int = yes; then
+ HAVE_UNSIGNED_LONG_LONG_INT=1
+ else
+ HAVE_UNSIGNED_LONG_LONG_INT=0
+ fi
+ AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT])
dnl Check for <wchar.h>.
AC_CHECK_HEADERS_ONCE([wchar.h])
diff --git a/gl/m4/ulonglong.m4 b/gl/m4/ulonglong.m4
index 15fab9f46e..9fae98e3a6 100644
--- a/gl/m4/ulonglong.m4
+++ b/gl/m4/ulonglong.m4
@@ -1,4 +1,4 @@
-# ulonglong.m4 serial 5
+# ulonglong.m4 serial 6
dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,6 +10,11 @@ dnl From Paul Eggert.
# This fixes a bug in Autoconf 2.60, but can be removed once we
# assume 2.61 everywhere.
+# Note: If the type 'unsigned long long int' exists but is only 32 bits
+# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
+# will not be defined. In this case you can treat 'unsigned long long int'
+# like 'unsigned long int'.
+
AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
[
AC_CACHE_CHECK([for unsigned long long int],
diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4
index 7ff3430350..32d3149b5f 100644
--- a/gl/m4/vasnprintf.m4
+++ b/gl/m4/vasnprintf.m4
@@ -1,5 +1,5 @@
-# vasnprintf.m4 serial 5
-dnl Copyright (C) 2002-2004 Free Software Foundation, Inc.
+# vasnprintf.m4 serial 6
+dnl Copyright (C) 2002-2004, 2006 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.
@@ -23,7 +23,7 @@ AC_DEFUN([gl_FUNC_VASNPRINTF],
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
AC_REQUIRE([bh_C_SIGNED])
- AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
+ AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
@@ -32,7 +32,7 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
# Prequisites of lib/printf-parse.h, lib/printf-parse.c.
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
- AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
+ AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
@@ -45,7 +45,7 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
AC_DEFUN([gl_PREREQ_VASNPRINTF],
[
AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
+ AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
diff --git a/gl/printf-args.c b/gl/printf-args.c
index 550c467009..ea76f29c50 100644
--- a/gl/printf-args.c
+++ b/gl/printf-args.c
@@ -56,7 +56,7 @@ printf_fetchargs (va_list args, arguments *a)
case TYPE_ULONGINT:
ap->a.a_ulongint = va_arg (args, unsigned long int);
break;
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
case TYPE_LONGLONGINT:
ap->a.a_longlongint = va_arg (args, long long int);
break;
@@ -128,7 +128,7 @@ printf_fetchargs (va_list args, arguments *a)
case TYPE_COUNT_LONGINT_POINTER:
ap->a.a_count_longint_pointer = va_arg (args, long int *);
break;
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
case TYPE_COUNT_LONGLONGINT_POINTER:
ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
break;
diff --git a/gl/printf-args.h b/gl/printf-args.h
index 38062463b6..4a4e972377 100644
--- a/gl/printf-args.h
+++ b/gl/printf-args.h
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2003, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -47,7 +47,7 @@ typedef enum
TYPE_UINT,
TYPE_LONGINT,
TYPE_ULONGINT,
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
TYPE_LONGLONGINT,
TYPE_ULONGLONGINT,
#endif
@@ -68,7 +68,7 @@ typedef enum
TYPE_COUNT_SHORT_POINTER,
TYPE_COUNT_INT_POINTER,
TYPE_COUNT_LONGINT_POINTER
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
, TYPE_COUNT_LONGLONGINT_POINTER
#endif
} arg_type;
@@ -87,7 +87,7 @@ typedef struct
unsigned int a_uint;
long int a_longint;
unsigned long int a_ulongint;
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
long long int a_longlongint;
unsigned long long int a_ulonglongint;
#endif
@@ -109,7 +109,7 @@ typedef struct
short * a_count_short_pointer;
int * a_count_int_pointer;
long int * a_count_longint_pointer;
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
long long int * a_count_longlongint_pointer;
#endif
}
diff --git a/gl/printf-parse.c b/gl/printf-parse.c
index bbf16ce8db..f0247c22c0 100644
--- a/gl/printf-parse.c
+++ b/gl/printf-parse.c
@@ -382,11 +382,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
switch (c)
{
case 'd': case 'i':
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
+ /* If 'long long' exists and is larger than 'long': */
if (flags >= 16 || (flags & 4))
type = TYPE_LONGLONGINT;
else
#endif
+ /* If 'long long' exists and is the same as 'long', we parse
+ "lld" into TYPE_LONGINT. */
if (flags >= 8)
type = TYPE_LONGINT;
else if (flags & 2)
@@ -397,11 +400,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
type = TYPE_INT;
break;
case 'o': case 'u': case 'x': case 'X':
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
+ /* If 'long long' exists and is larger than 'long': */
if (flags >= 16 || (flags & 4))
type = TYPE_ULONGLONGINT;
else
#endif
+ /* If 'unsigned long long' exists and is the same as
+ 'unsigned long', we parse "llu" into TYPE_ULONGINT. */
if (flags >= 8)
type = TYPE_ULONGINT;
else if (flags & 2)
@@ -456,11 +462,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
type = TYPE_POINTER;
break;
case 'n':
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
+ /* If 'long long' exists and is larger than 'long': */
if (flags >= 16 || (flags & 4))
type = TYPE_COUNT_LONGLONGINT_POINTER;
else
#endif
+ /* If 'long long' exists and is the same as 'long', we parse
+ "lln" into TYPE_COUNT_LONGINT_POINTER. */
if (flags >= 8)
type = TYPE_COUNT_LONGINT_POINTER;
else if (flags & 2)
diff --git a/gl/stdint_.h b/gl/stdint_.h
index 033bf92c5b..7866bf7f6d 100644
--- a/gl/stdint_.h
+++ b/gl/stdint_.h
@@ -124,15 +124,20 @@
#define uint32_t unsigned int
#undef int64_t
-#undef uint64_t
#if LONG_MAX >> 31 >> 31 == 1
# define int64_t long int
-# define uint64_t unsigned long int
#elif defined _MSC_VER
# define int64_t __int64
-# define uint64_t unsigned __int64
#elif @HAVE_LONG_LONG_INT@
# define int64_t long long int
+#endif
+
+#undef uint64_t
+#if ULONG_MAX >> 31 >> 31 >> 1 == 1
+# define uint64_t unsigned long int
+#elif defined _MSC_VER
+# define uint64_t unsigned __int64
+#elif @HAVE_UNSIGNED_LONG_LONG_INT@
# define uint64_t unsigned long long int
#endif
@@ -164,6 +169,8 @@
#define uint_least32_t uint32_t
#ifdef int64_t
# define int_least64_t int64_t
+#endif
+#ifdef uint64_t
# define uint_least64_t uint64_t
#endif
@@ -193,6 +200,8 @@
#define uint_fast32_t unsigned int_fast32_t
#ifdef int64_t
# define int_fast64_t int64_t
+#endif
+#ifdef uint64_t
# define uint_fast64_t uint64_t
#endif
@@ -209,15 +218,20 @@
public header files. */
#undef intmax_t
-#undef uintmax_t
#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
# define intmax_t long long int
-# define uintmax_t unsigned long long int
#elif defined int64_t
# define intmax_t int64_t
-# define uintmax_t uint64_t
#else
# define intmax_t long int
+#endif
+
+#undef uintmax_t
+#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+# define uintmax_t unsigned long long int
+#elif defined int64_t
+# define uintmax_t uint64_t
+#else
# define uintmax_t unsigned long int
#endif
@@ -253,10 +267,13 @@
#undef INT64_MIN
#undef INT64_MAX
-#undef UINT64_MAX
#ifdef int64_t
# define INT64_MIN (~ INT64_MAX)
# define INT64_MAX INTMAX_C (9223372036854775807)
+#endif
+
+#undef UINT64_MAX
+#ifdef uint64_t
# define UINT64_MAX UINTMAX_C (18446744073709551615)
#endif
@@ -289,10 +306,13 @@
#undef INT_LEAST64_MIN
#undef INT_LEAST64_MAX
-#undef UINT_LEAST64_MAX
#ifdef int64_t
# define INT_LEAST64_MIN INT64_MIN
# define INT_LEAST64_MAX INT64_MAX
+#endif
+
+#undef UINT_LEAST64_MAX
+#ifdef uint64_t
# define UINT_LEAST64_MAX UINT64_MAX
#endif
@@ -325,10 +345,13 @@
#undef INT_FAST64_MIN
#undef INT_FAST64_MAX
-#undef UINT_FAST64_MAX
#ifdef int64_t
# define INT_FAST64_MIN INT64_MIN
# define INT_FAST64_MAX INT64_MAX
+#endif
+
+#undef UINT_FAST64_MAX
+#ifdef uint64_t
# define UINT_FAST64_MAX UINT64_MAX
#endif
@@ -345,13 +368,17 @@
#undef INTMAX_MIN
#undef INTMAX_MAX
-#undef UINTMAX_MAX
#define INTMAX_MIN (~ INTMAX_MAX)
#ifdef INT64_MAX
# define INTMAX_MAX INT64_MAX
-# define UINTMAX_MAX UINT64_MAX
#else
# define INTMAX_MAX INT32_MAX
+#endif
+
+#undef UINTMAX_MAX
+#ifdef UINT64_MAX
+# define UINTMAX_MAX UINT64_MAX
+#else
# define UINTMAX_MAX UINT32_MAX
#endif
@@ -427,27 +454,36 @@
#undef UINT64_C
#if LONG_MAX >> 31 >> 31 == 1
# define INT64_C(x) x##L
-# define UINT64_C(x) x##UL
#elif defined _MSC_VER
# define INT64_C(x) x##i64
-# define UINT64_C(x) x##ui64
#elif @HAVE_LONG_LONG_INT@
# define INT64_C(x) x##LL
+#endif
+#if ULONG_MAX >> 31 >> 31 >> 1 == 1
+# define UINT64_C(x) x##UL
+#elif defined _MSC_VER
+# define UINT64_C(x) x##ui64
+#elif @HAVE_UNSIGNED_LONG_LONG_INT@
# define UINT64_C(x) x##ULL
#endif
/* 7.18.4.2. Macros for greatest-width integer constants */
#undef INTMAX_C
-#undef UINTMAX_C
#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
# define INTMAX_C(x) x##LL
-# define UINTMAX_C(x) x##ULL
#elif defined int64_t
# define INTMAX_C(x) INT64_C(x)
-# define UINTMAX_C(x) UINT64_C(x)
#else
# define INTMAX_C(x) x##L
+#endif
+
+#undef UINTMAX_C
+#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+# define UINTMAX_C(x) x##ULL
+#elif defined uint64_t
+# define UINTMAX_C(x) UINT64_C(x)
+#else
# define UINTMAX_C(x) x##UL
#endif
diff --git a/gl/strdup.c b/gl/strdup.c
index ac680e856e..7b1cd7ca1c 100644
--- a/gl/strdup.c
+++ b/gl/strdup.c
@@ -27,7 +27,9 @@
#include <string.h>
#undef __strdup
-#undef strdup
+#ifdef _LIBC
+# undef strdup
+#endif
#ifndef weak_alias
# define __strdup strdup
diff --git a/gl/vasnprintf.c b/gl/vasnprintf.c
index d2ba4bc0dd..8f6730468b 100644
--- a/gl/vasnprintf.c
+++ b/gl/vasnprintf.c
@@ -248,7 +248,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
case TYPE_COUNT_LONGINT_POINTER:
*a.arg[dp->arg_index].a.a_count_longint_pointer = length;
break;
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
case TYPE_COUNT_LONGLONGINT_POINTER:
*a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
break;
@@ -322,7 +322,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
{
case 'd': case 'i': case 'u':
-# ifdef HAVE_LONG_LONG
+# ifdef HAVE_LONG_LONG_INT
if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
tmp_length =
(unsigned int) (sizeof (unsigned long long) * CHAR_BIT
@@ -352,7 +352,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
break;
case 'o':
-# ifdef HAVE_LONG_LONG
+# ifdef HAVE_LONG_LONG_INT
if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
tmp_length =
(unsigned int) (sizeof (unsigned long long) * CHAR_BIT
@@ -380,7 +380,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
break;
case 'x': case 'X':
-# ifdef HAVE_LONG_LONG
+# ifdef HAVE_LONG_LONG_INT
if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
tmp_length =
(unsigned int) (sizeof (unsigned long long) * CHAR_BIT
@@ -527,7 +527,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
switch (type)
{
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
case TYPE_LONGLONGINT:
case TYPE_ULONGLONGINT:
*p++ = 'l';
@@ -681,7 +681,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
SNPRINTF_BUF (arg);
}
break;
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
case TYPE_LONGLONGINT:
{
long long int arg = a.arg[dp->arg_index].a.a_longlongint;