diff options
author | Bruno Haible <bruno@clisp.org> | 2006-08-28 12:54:47 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2006-08-28 12:54:47 +0000 |
commit | 81941926b6fc72b671e7eb5e98c5e4e55e85eb0e (patch) | |
tree | 1ff9dc45adf95bd00ed943e5732cd45c703b3a1e | |
parent | eb6d07a070b018aa129327c85dd7ef5f9ed44150 (diff) | |
download | gnulib-81941926b6fc72b671e7eb5e98c5e4e55e85eb0e.tar.gz |
Rewritten inttypes module. New modules imaxabs, imaxdiv.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | lib/ChangeLog | 10 | ||||
-rw-r--r-- | lib/stdint_.h | 2 | ||||
-rw-r--r-- | m4/ChangeLog | 11 | ||||
-rw-r--r-- | m4/inttypes-pri.m4 | 6 | ||||
-rw-r--r-- | m4/stdint.m4 | 6 | ||||
-rw-r--r-- | modules/inttypes | 30 | ||||
-rw-r--r-- | modules/stdint | 3 |
8 files changed, 68 insertions, 11 deletions
@@ -1,3 +1,14 @@ +2006-08-26 Bruno Haible <bruno@clisp.org> + + * 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 <eggert@cs.ucla.edu> New config-h module, so that "make" output needn't be cluttered diff --git a/lib/ChangeLog b/lib/ChangeLog index 0ff5c45c49..3232dd753d 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,13 @@ +2006-08-26 Bruno Haible <bruno@clisp.org> + + * inttypes_.h: New file. + * inttypes.h: Remove file. + * stdint_.h: Include <inttypes.h> through its absolute filename. + + * imaxabs.c: New file. + + * imaxdiv.c: New file. + 2006-08-22 Bruno Haible <bruno@clisp.org> * readutmp.h: Skip most definitions if neither <utmp.h> nor diff --git a/lib/stdint_.h b/lib/stdint_.h index 44eca933ca..9c0c47d08b 100644 --- a/lib/stdint_.h +++ b/lib/stdint_.h @@ -62,7 +62,7 @@ /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. <inttypes.h> also defines intptr_t and uintptr_t. */ -# include <inttypes.h> +# include @ABSOLUTE_INTTYPES_H@ #elif @HAVE_SYS_INTTYPES_H@ /* Solaris 7 <sys/inttypes.h> 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 972d36a6e5..d350d992c0 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,14 @@ +2006-08-26 Bruno Haible <bruno@clisp.org> + + * 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 <eggert@cs.ucla.edu> * config-h.m4: New file. diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4 index ef00da7420..6b53d0b6f6 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 <inttypes.h> 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 48748c6139..b48fb9d379 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 <inttypes.h>. 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 <sys/types.h>. diff --git a/modules/inttypes b/modules/inttypes index ccbb484dbc..75c4e04e2f 100644 --- a/modules/inttypes +++ b/modules/inttypes @@ -1,21 +1,37 @@ Description: -A wrapper C99 <inttypes.h> header which will always include <stdint.h> -(possibly the *almost* C99 compliant GNULIB <stdint.h>) and prototypes for the -strtoimax & strtoumax functions. +An <inttypes.h> 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 <inttypes.h> 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 <inttypes.h> diff --git a/modules/stdint b/modules/stdint index f8dc06eb16..657953b84b 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' \ |