From: Bruno Haible Date: Mon, 28 Aug 2006 12:54:47 +0000 (+0000) Subject: Rewritten inttypes module. New modules imaxabs, imaxdiv. X-Git-Tag: cvs-readonly~1979 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=81941926b6fc72b671e7eb5e98c5e4e55e85eb0e;p=gnulib.git Rewritten inttypes module. New modules imaxabs, imaxdiv. --- diff --git a/ChangeLog b/ChangeLog index 696b22f47..447f6f0ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-08-26 Bruno Haible + + * modules/inttypes (Files): Add lib/inttypes_.h, remove lib/inttypes.h. + Add m4/inttypes.m4, remove m4/_inttypes_h.m4 and m4/include_next.m4. + (Makefile.am): Create inttypes.h from inttypes_.h. + * modules/stdint (Makefile.am): Substitute also ABSOLUTE_INTTYPES_H. + + * modules/imaxabs: New file. + + * modules/imaxdiv: New file. + 2006-08-25 Paul Eggert New config-h module, so that "make" output needn't be cluttered diff --git a/lib/ChangeLog b/lib/ChangeLog index 0ff5c45c4..3232dd753 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,13 @@ +2006-08-26 Bruno Haible + + * inttypes_.h: New file. + * inttypes.h: Remove file. + * stdint_.h: Include through its absolute filename. + + * imaxabs.c: New file. + + * imaxdiv.c: New file. + 2006-08-22 Bruno Haible * readutmp.h: Skip most definitions if neither nor diff --git a/lib/stdint_.h b/lib/stdint_.h index 44eca933c..9c0c47d08 100644 --- a/lib/stdint_.h +++ b/lib/stdint_.h @@ -62,7 +62,7 @@ /* In OpenBSD 3.8, includes , which defines int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. also defines intptr_t and uintptr_t. */ -# include +# include @ABSOLUTE_INTTYPES_H@ #elif @HAVE_SYS_INTTYPES_H@ /* Solaris 7 has the types except the *_fast*_t types, and the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ diff --git a/m4/ChangeLog b/m4/ChangeLog index 972d36a6e..d350d992c 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,14 @@ +2006-08-26 Bruno Haible + + * inttypes.m4: New file. + * _inttypes_h.m4: Remove file. + * inttypes-pri.m4 (gt_INTTYPES_PRI): Also AC_SUBST PRI_MACROS_BROKEN. + * stdint.m4 (gl_STDINT_H): Define also ABSOLUTE_INTTYPES_H. + + * imaxabs.m4: New file. + + * imaxdiv.m4: New file. + 2006-08-25 Paul Eggert * config-h.m4: New file. diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4 index ef00da742..6b53d0b6f 100644 --- a/m4/inttypes-pri.m4 +++ b/m4/inttypes-pri.m4 @@ -1,4 +1,4 @@ -# inttypes-pri.m4 serial 2 (gettext-0.15) +# inttypes-pri.m4 serial 3 (gettext-0.15.1) dnl Copyright (C) 1997-2002, 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, @@ -26,5 +26,9 @@ char *p = PRId32; if test "$gt_cv_inttypes_pri_broken" = yes; then AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, [Define if exists and defines unusable PRI* macros.]) + PRI_MACROS_BROKEN=1 + else + PRI_MACROS_BROKEN=0 fi + AC_SUBST([PRI_MACROS_BROKEN]) ]) diff --git a/m4/stdint.m4 b/m4/stdint.m4 index 48748c613..b48fb9d37 100644 --- a/m4/stdint.m4 +++ b/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, @@ -32,10 +32,14 @@ AC_DEFUN([gl_STDINT_H], dnl Check for . dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. if test $ac_cv_header_inttypes_h = yes; then + gl_ABSOLUTE_HEADER([inttypes.h]) + ABSOLUTE_INTTYPES_H=\"$gl_cv_absolute_inttypes_h\" HAVE_INTTYPES_H=1 else + ABSOLUTE_INTTYPES_H=\"no/such/file/inttypes.h\" HAVE_INTTYPES_H=0 fi + AC_SUBST([ABSOLUTE_INTTYPES_H]) AC_SUBST([HAVE_INTTYPES_H]) dnl Check for . diff --git a/modules/inttypes b/modules/inttypes index ccbb484db..75c4e04e2 100644 --- a/modules/inttypes +++ b/modules/inttypes @@ -1,21 +1,37 @@ Description: -A wrapper C99 header which will always include -(possibly the *almost* C99 compliant GNULIB ) and prototypes for the -strtoimax & strtoumax functions. +An that nearly conforms to C99. Files: -lib/inttypes.h -m4/include_next.m4 +lib/inttypes_.h m4/absolute-header.m4 -m4/_inttypes_h.m4 +m4/inttypes-pri.m4 +m4/inttypes.m4 Depends-on: +stdint configure.ac: gl_INTTYPES_H Makefile.am: -EXTRA_DIST += inttypes.h +BUILT_SOURCES += $(INTTYPES_H) +EXTRA_DIST += inttypes_.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +inttypes.h: inttypes_.h + sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ + -e 's/@''ABSOLUTE_INTTYPES_H''@/$(ABSOLUTE_INTTYPES_H)/g' \ + -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ + -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ + -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ + -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \ + -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ + -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ + -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ + < $(srcdir)/inttypes_.h > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += inttypes.h inttypes.h-t Include: #include diff --git a/modules/stdint b/modules/stdint index f8dc06eb1..657953b84 100644 --- a/modules/stdint +++ b/modules/stdint @@ -26,9 +26,10 @@ EXTRA_DIST += stdint_.h stdint.h: stdint_.h sed -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ - -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_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|@''ABSOLUTE_INTTYPES_H''@|$(ABSOLUTE_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' \