[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
rewritten inttypes module
From: |
Bruno Haible |
Subject: |
rewritten inttypes module |
Date: |
Mon, 24 Jul 2006 18:29:40 +0200 |
User-agent: |
KMail/1.9.1 |
Hi,
After the complete stdint module, and now that gettext has renamed its
earlier inttypes.m4 macro file, we're now ready for a complete <inttypes.h>
replacement. The proposed rewrite consists of 5 modules:
- inttypes provides only the header file <inttypes.h>,
- imaxabs, imaxdiv provide just the particular functions
- strtoimax, strtoumax likewise, unmodified
2006-07-23 Bruno Haible <address@hidden>
* 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.
* lib/inttypes_.h: New file.
* lib/inttypes.h: Remove file.
* m4/inttypes.m4: New file.
* m4/_inttypes_h.m4: Remove file.
* lib/stdint_.h: Include <inttypes.h> through its absolute filename.
* m4/stdint.m4 (gl_STDINT_H): Define also ABSOLUTE_INTTYPES_H.
* modules/stdint (Makefile.am): Substitute also ABSOLUTE_INTTYPES_H.
* modules/imaxabs: New file.
* lib/imaxabs.c: New file.
* m4/imaxabs.m4: New file.
* modules/imaxdiv: New file.
* lib/imaxdiv.c: New file.
* m4/imaxdiv.m4: New file.
diff -r -c3 --unidirectional-new-file --exclude=CVS
gnulib-20060722/modules/inttypes gnulib-20060722-modified/modules/inttypes
*** gnulib-20060722/modules/inttypes 2006-07-05 19:37:40.000000000 +0200
--- gnulib-20060722-modified/modules/inttypes 2006-07-23 03:18:41.000000000
+0200
***************
*** 1,13 ****
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.
Files:
! lib/inttypes.h
! m4/include_next.m4
m4/absolute-header.m4
! m4/_inttypes_h.m4
Depends-on:
--- 1,10 ----
Description:
! An <inttypes.h> that nearly conforms to C99.
Files:
! lib/inttypes_.h
m4/absolute-header.m4
! m4/inttypes.m4
Depends-on:
***************
*** 15,20 ****
--- 12,34 ----
gl_INTTYPES_H
Makefile.am:
+ 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/@''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 > address@hidden
+ mv address@hidden $@
+ MOSTLYCLEANFILES += inttypes.h inttypes.h-t
Include:
#include <inttypes.h>
diff -r -c3 --unidirectional-new-file --exclude=CVS
gnulib-20060722/lib/inttypes_.h gnulib-20060722-modified/lib/inttypes_.h
*** gnulib-20060722/lib/inttypes_.h 1970-01-01 01:00:00.000000000 +0100
--- gnulib-20060722-modified/lib/inttypes_.h 2006-07-23 03:14:44.000000000
+0200
***************
*** 0 ****
--- 1,1029 ----
+ /* Copyright (C) 2006 Free Software Foundation, Inc.
+ Written by Paul Eggert, Bruno Haible, Derek Price.
+ This file is part of gnulib.
+
+ 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
+ the Free Software Foundation; either version 2.1, 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 Lesser General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+ #ifndef INTTYPES_H
+ #define INTTYPES_H
+
+ /*
+ * ISO C 99 <inttypes.h> for platforms that lack it.
+ * <http://www.opengroup.org/susv3xbd/inttypes.h.html>
+ */
+
+ /* Include the original <inttypes.h> if it exists. */
+ #if @HAVE_INTTYPES_H@
+ # include @ABSOLUTE_INTTYPES_H@
+ #endif
+ /* Include <stdint.h> or the gnulib replacement. */
+ #include <stdint.h>
+ /* Get CHAR_BIT. */
+ #include <limits.h>
+
+ /* 7.8.1 Macros for format specifiers */
+
+ #if !defined PRId8 || PRI_MACROS_BROKEN
+ # undef PRId8
+ # define PRId8 "d"
+ #endif
+ #if !defined PRIi8 || PRI_MACROS_BROKEN
+ # undef PRIi8
+ # define PRIi8 "i"
+ #endif
+ #if !defined PRIo8 || PRI_MACROS_BROKEN
+ # undef PRIo8
+ # define PRIo8 "o"
+ #endif
+ #if !defined PRIu8 || PRI_MACROS_BROKEN
+ # undef PRIu8
+ # define PRIu8 "u"
+ #endif
+ #if !defined PRIx8 || PRI_MACROS_BROKEN
+ # undef PRIx8
+ # define PRIx8 "x"
+ #endif
+ #if !defined PRIX8 || PRI_MACROS_BROKEN
+ # undef PRIX8
+ # define PRIX8 "X"
+ #endif
+ #if !defined PRId16 || PRI_MACROS_BROKEN
+ # undef PRId16
+ # define PRId16 "d"
+ #endif
+ #if !defined PRIi16 || PRI_MACROS_BROKEN
+ # undef PRIi16
+ # define PRIi16 "i"
+ #endif
+ #if !defined PRIo16 || PRI_MACROS_BROKEN
+ # undef PRIo16
+ # define PRIo16 "o"
+ #endif
+ #if !defined PRIu16 || PRI_MACROS_BROKEN
+ # undef PRIu16
+ # define PRIu16 "u"
+ #endif
+ #if !defined PRIx16 || PRI_MACROS_BROKEN
+ # undef PRIx16
+ # define PRIx16 "x"
+ #endif
+ #if !defined PRIX16 || PRI_MACROS_BROKEN
+ # undef PRIX16
+ # define PRIX16 "X"
+ #endif
+ #if !defined PRId32 || PRI_MACROS_BROKEN
+ # undef PRId32
+ # define PRId32 "d"
+ #endif
+ #if !defined PRIi32 || PRI_MACROS_BROKEN
+ # undef PRIi32
+ # define PRIi32 "i"
+ #endif
+ #if !defined PRIo32 || PRI_MACROS_BROKEN
+ # undef PRIo32
+ # define PRIo32 "o"
+ #endif
+ #if !defined PRIu32 || PRI_MACROS_BROKEN
+ # undef PRIu32
+ # define PRIu32 "u"
+ #endif
+ #if !defined PRIx32 || PRI_MACROS_BROKEN
+ # undef PRIx32
+ # define PRIx32 "x"
+ #endif
+ #if !defined PRIX32 || PRI_MACROS_BROKEN
+ # undef PRIX32
+ # define PRIX32 "X"
+ #endif
+ #ifdef INT64_MAX
+ # if INT64_MAX == LONG_MAX
+ # define _PRI64_PREFIX "l"
+ # elif defined _MSC_VER || defined __MINGW32__
+ # define _PRI64_PREFIX "I64"
+ # elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+ # define _PRI64_PREFIX "ll"
+ # endif
+ # if !defined PRId64 || PRI_MACROS_BROKEN
+ # undef PRId64
+ # define PRId64 _PRI64_PREFIX "d"
+ # endif
+ # if !defined PRIi64 || PRI_MACROS_BROKEN
+ # undef PRIi64
+ # define PRIi64 _PRI64_PREFIX "i"
+ # endif
+ #endif
+ #ifdef UINT64_MAX
+ # if INT64_MAX == LONG_MAX
+ # define _PRIu64_PREFIX "l"
+ # elif defined _MSC_VER || defined __MINGW32__
+ # define _PRIu64_PREFIX "I64"
+ # elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+ # define _PRIu64_PREFIX "ll"
+ # endif
+ # if !defined PRIo64 || PRI_MACROS_BROKEN
+ # undef PRIo64
+ # define PRIo64 _PRIu64_PREFIX "o"
+ # endif
+ # if !defined PRIu64 || PRI_MACROS_BROKEN
+ # undef PRIu64
+ # define PRIu64 _PRIu64_PREFIX "u"
+ # endif
+ # if !defined PRIx64 || PRI_MACROS_BROKEN
+ # undef PRIx64
+ # define PRIx64 _PRIu64_PREFIX "x"
+ # endif
+ # if !defined PRIX64 || PRI_MACROS_BROKEN
+ # undef PRIX64
+ # define PRIX64 _PRIu64_PREFIX "X"
+ # endif
+ #endif
+
+ #if !defined PRIdLEAST8 || PRI_MACROS_BROKEN
+ # undef PRIdLEAST8
+ # define PRIdLEAST8 "d"
+ #endif
+ #if !defined PRIiLEAST8 || PRI_MACROS_BROKEN
+ # undef PRIiLEAST8
+ # define PRIiLEAST8 "i"
+ #endif
+ #if !defined PRIoLEAST8 || PRI_MACROS_BROKEN
+ # undef PRIoLEAST8
+ # define PRIoLEAST8 "o"
+ #endif
+ #if !defined PRIuLEAST8 || PRI_MACROS_BROKEN
+ # undef PRIuLEAST8
+ # define PRIuLEAST8 "u"
+ #endif
+ #if !defined PRIxLEAST8 || PRI_MACROS_BROKEN
+ # undef PRIxLEAST8
+ # define PRIxLEAST8 "x"
+ #endif
+ #if !defined PRIXLEAST8 || PRI_MACROS_BROKEN
+ # undef PRIXLEAST8
+ # define PRIXLEAST8 "X"
+ #endif
+ #if !defined PRIdLEAST16 || PRI_MACROS_BROKEN
+ # undef PRIdLEAST16
+ # define PRIdLEAST16 "d"
+ #endif
+ #if !defined PRIiLEAST16 || PRI_MACROS_BROKEN
+ # undef PRIiLEAST16
+ # define PRIiLEAST16 "i"
+ #endif
+ #if !defined PRIoLEAST16 || PRI_MACROS_BROKEN
+ # undef PRIoLEAST16
+ # define PRIoLEAST16 "o"
+ #endif
+ #if !defined PRIuLEAST16 || PRI_MACROS_BROKEN
+ # undef PRIuLEAST16
+ # define PRIuLEAST16 "u"
+ #endif
+ #if !defined PRIxLEAST16 || PRI_MACROS_BROKEN
+ # undef PRIxLEAST16
+ # define PRIxLEAST16 "x"
+ #endif
+ #if !defined PRIXLEAST16 || PRI_MACROS_BROKEN
+ # undef PRIXLEAST16
+ # define PRIXLEAST16 "X"
+ #endif
+ #if !defined PRIdLEAST32 || PRI_MACROS_BROKEN
+ # undef PRIdLEAST32
+ # define PRIdLEAST32 "d"
+ #endif
+ #if !defined PRIiLEAST32 || PRI_MACROS_BROKEN
+ # undef PRIiLEAST32
+ # define PRIiLEAST32 "i"
+ #endif
+ #if !defined PRIoLEAST32 || PRI_MACROS_BROKEN
+ # undef PRIoLEAST32
+ # define PRIoLEAST32 "o"
+ #endif
+ #if !defined PRIuLEAST32 || PRI_MACROS_BROKEN
+ # undef PRIuLEAST32
+ # define PRIuLEAST32 "u"
+ #endif
+ #if !defined PRIxLEAST32 || PRI_MACROS_BROKEN
+ # undef PRIxLEAST32
+ # define PRIxLEAST32 "x"
+ #endif
+ #if !defined PRIXLEAST32 || PRI_MACROS_BROKEN
+ # undef PRIXLEAST32
+ # define PRIXLEAST32 "X"
+ #endif
+ #ifdef INT64_MAX
+ # if !defined PRIdLEAST64 || PRI_MACROS_BROKEN
+ # undef PRIdLEAST64
+ # define PRIdLEAST64 PRId64
+ # endif
+ # if !defined PRIiLEAST64 || PRI_MACROS_BROKEN
+ # undef PRIiLEAST64
+ # define PRIiLEAST64 PRIi64
+ # endif
+ #endif
+ #ifdef UINT64_MAX
+ # if !defined PRIoLEAST64 || PRI_MACROS_BROKEN
+ # undef PRIoLEAST64
+ # define PRIoLEAST64 PRIo64
+ # endif
+ # if !defined PRIuLEAST64 || PRI_MACROS_BROKEN
+ # undef PRIuLEAST64
+ # define PRIuLEAST64 PRIu64
+ # endif
+ # if !defined PRIxLEAST64 || PRI_MACROS_BROKEN
+ # undef PRIxLEAST64
+ # define PRIxLEAST64 PRIx64
+ # endif
+ # if !defined PRIXLEAST64 || PRI_MACROS_BROKEN
+ # undef PRIXLEAST64
+ # define PRIXLEAST64 PRIX64
+ # endif
+ #endif
+
+ #if !defined PRIdFAST8 || PRI_MACROS_BROKEN
+ # undef PRIdFAST8
+ # if INT_FAST8_MAX > INT32_MAX
+ # define PRIdFAST8 PRId64
+ # else
+ # define PRIdFAST8 "d"
+ # endif
+ #endif
+ #if !defined PRIiFAST8 || PRI_MACROS_BROKEN
+ # undef PRIiFAST8
+ # if INT_FAST8_MAX > INT32_MAX
+ # define PRIiFAST8 PRIi64
+ # else
+ # define PRIiFAST8 "i"
+ # endif
+ #endif
+ #if !defined PRIoFAST8 || PRI_MACROS_BROKEN
+ # undef PRIoFAST8
+ # if UINT_FAST8_MAX > UINT32_MAX
+ # define PRIoFAST8 PRIo64
+ # else
+ # define PRIoFAST8 "o"
+ # endif
+ #endif
+ #if !defined PRIuFAST8 || PRI_MACROS_BROKEN
+ # undef PRIuFAST8
+ # if UINT_FAST8_MAX > UINT32_MAX
+ # define PRIuFAST8 PRIu64
+ # else
+ # define PRIuFAST8 "u"
+ # endif
+ #endif
+ #if !defined PRIxFAST8 || PRI_MACROS_BROKEN
+ # undef PRIxFAST8
+ # if UINT_FAST8_MAX > UINT32_MAX
+ # define PRIxFAST8 PRIx64
+ # else
+ # define PRIxFAST8 "x"
+ # endif
+ #endif
+ #if !defined PRIXFAST8 || PRI_MACROS_BROKEN
+ # undef PRIXFAST8
+ # if UINT_FAST8_MAX > UINT32_MAX
+ # define PRIXFAST8 PRIX64
+ # else
+ # define PRIXFAST8 "X"
+ # endif
+ #endif
+ #if !defined PRIdFAST16 || PRI_MACROS_BROKEN
+ # undef PRIdFAST16
+ # if INT_FAST16_MAX > INT32_MAX
+ # define PRIdFAST16 PRId64
+ # else
+ # define PRIdFAST16 "d"
+ # endif
+ #endif
+ #if !defined PRIiFAST16 || PRI_MACROS_BROKEN
+ # undef PRIiFAST16
+ # if INT_FAST16_MAX > INT32_MAX
+ # define PRIiFAST16 PRIi64
+ # else
+ # define PRIiFAST16 "i"
+ # endif
+ #endif
+ #if !defined PRIoFAST16 || PRI_MACROS_BROKEN
+ # undef PRIoFAST16
+ # if UINT_FAST16_MAX > UINT32_MAX
+ # define PRIoFAST16 PRIo64
+ # else
+ # define PRIoFAST16 "o"
+ # endif
+ #endif
+ #if !defined PRIuFAST16 || PRI_MACROS_BROKEN
+ # undef PRIuFAST16
+ # if UINT_FAST16_MAX > UINT32_MAX
+ # define PRIuFAST16 PRIu64
+ # else
+ # define PRIuFAST16 "u"
+ # endif
+ #endif
+ #if !defined PRIxFAST16 || PRI_MACROS_BROKEN
+ # undef PRIxFAST16
+ # if UINT_FAST16_MAX > UINT32_MAX
+ # define PRIxFAST16 PRIx64
+ # else
+ # define PRIxFAST16 "x"
+ # endif
+ #endif
+ #if !defined PRIXFAST16 || PRI_MACROS_BROKEN
+ # undef PRIXFAST16
+ # if UINT_FAST16_MAX > UINT32_MAX
+ # define PRIXFAST16 PRIX64
+ # else
+ # define PRIXFAST16 "X"
+ # endif
+ #endif
+ #if !defined PRIdFAST32 || PRI_MACROS_BROKEN
+ # undef PRIdFAST32
+ # if INT_FAST32_MAX > INT32_MAX
+ # define PRIdFAST32 PRId64
+ # else
+ # define PRIdFAST32 "d"
+ # endif
+ #endif
+ #if !defined PRIiFAST32 || PRI_MACROS_BROKEN
+ # undef PRIiFAST32
+ # if INT_FAST32_MAX > INT32_MAX
+ # define PRIiFAST32 PRIi64
+ # else
+ # define PRIiFAST32 "i"
+ # endif
+ #endif
+ #if !defined PRIoFAST32 || PRI_MACROS_BROKEN
+ # undef PRIoFAST32
+ # if UINT_FAST32_MAX > UINT32_MAX
+ # define PRIoFAST32 PRIo64
+ # else
+ # define PRIoFAST32 "o"
+ # endif
+ #endif
+ #if !defined PRIuFAST32 || PRI_MACROS_BROKEN
+ # undef PRIuFAST32
+ # if UINT_FAST32_MAX > UINT32_MAX
+ # define PRIuFAST32 PRIu64
+ # else
+ # define PRIuFAST32 "u"
+ # endif
+ #endif
+ #if !defined PRIxFAST32 || PRI_MACROS_BROKEN
+ # undef PRIxFAST32
+ # if UINT_FAST32_MAX > UINT32_MAX
+ # define PRIxFAST32 PRIx64
+ # else
+ # define PRIxFAST32 "x"
+ # endif
+ #endif
+ #if !defined PRIXFAST32 || PRI_MACROS_BROKEN
+ # undef PRIXFAST32
+ # if UINT_FAST32_MAX > UINT32_MAX
+ # define PRIXFAST32 PRIX64
+ # else
+ # define PRIXFAST32 "X"
+ # endif
+ #endif
+ #ifdef INT64_MAX
+ # if !defined PRIdFAST64 || PRI_MACROS_BROKEN
+ # undef PRIdFAST64
+ # define PRIdFAST64 PRId64
+ # endif
+ # if !defined PRIiFAST64 || PRI_MACROS_BROKEN
+ # undef PRIiFAST64
+ # define PRIiFAST64 PRIi64
+ # endif
+ #endif
+ #ifdef UINT64_MAX
+ # if !defined PRIoFAST64 || PRI_MACROS_BROKEN
+ # undef PRIoFAST64
+ # define PRIoFAST64 PRIo64
+ # endif
+ # if !defined PRIuFAST64 || PRI_MACROS_BROKEN
+ # undef PRIuFAST64
+ # define PRIuFAST64 PRIu64
+ # endif
+ # if !defined PRIxFAST64 || PRI_MACROS_BROKEN
+ # undef PRIxFAST64
+ # define PRIxFAST64 PRIx64
+ # endif
+ # if !defined PRIXFAST64 || PRI_MACROS_BROKEN
+ # undef PRIXFAST64
+ # define PRIXFAST64 PRIX64
+ # endif
+ #endif
+
+ #if !defined PRIdMAX || PRI_MACROS_BROKEN
+ # undef PRIdMAX
+ # if INTMAX_MAX > INT32_MAX
+ # define PRIdMAX PRId64
+ # else
+ # define PRIdMAX "ld"
+ # endif
+ #endif
+ #if !defined PRIiMAX || PRI_MACROS_BROKEN
+ # undef PRIiMAX
+ # if INTMAX_MAX > INT32_MAX
+ # define PRIiMAX PRIi64
+ # else
+ # define PRIiMAX "li"
+ # endif
+ #endif
+ #if !defined PRIoMAX || PRI_MACROS_BROKEN
+ # undef PRIoMAX
+ # if UINTMAX_MAX > UINT32_MAX
+ # define PRIoMAX PRIo64
+ # else
+ # define PRIoMAX "lo"
+ # endif
+ #endif
+ #if !defined PRIuMAX || PRI_MACROS_BROKEN
+ # undef PRIuMAX
+ # if UINTMAX_MAX > UINT32_MAX
+ # define PRIuMAX PRIu64
+ # else
+ # define PRIuMAX "lu"
+ # endif
+ #endif
+ #if !defined PRIxMAX || PRI_MACROS_BROKEN
+ # undef PRIxMAX
+ # if UINTMAX_MAX > UINT32_MAX
+ # define PRIxMAX PRIx64
+ # else
+ # define PRIxMAX "lx"
+ # endif
+ #endif
+ #if !defined PRIXMAX || PRI_MACROS_BROKEN
+ # undef PRIXMAX
+ # if UINTMAX_MAX > UINT32_MAX
+ # define PRIXMAX PRIX64
+ # else
+ # define PRIXMAX "lX"
+ # endif
+ #endif
+
+ #if !defined PRIdPTR || PRI_MACROS_BROKEN
+ # undef PRIdPTR
+ # define PRIdPTR @PRIPTR_PREFIX@ "d"
+ #endif
+ #if !defined PRIiPTR || PRI_MACROS_BROKEN
+ # undef PRIiPTR
+ # define PRIiPTR @PRIPTR_PREFIX@ "i"
+ #endif
+ #if !defined PRIoPTR || PRI_MACROS_BROKEN
+ # undef PRIoPTR
+ # define PRIoPTR @PRIPTR_PREFIX@ "o"
+ #endif
+ #if !defined PRIuPTR || PRI_MACROS_BROKEN
+ # undef PRIuPTR
+ # define PRIuPTR @PRIPTR_PREFIX@ "u"
+ #endif
+ #if !defined PRIxPTR || PRI_MACROS_BROKEN
+ # undef PRIxPTR
+ # define PRIxPTR @PRIPTR_PREFIX@ "x"
+ #endif
+ #if !defined PRIXPTR || PRI_MACROS_BROKEN
+ # undef PRIXPTR
+ # define PRIXPTR @PRIPTR_PREFIX@ "X"
+ #endif
+
+ #if !defined SCNd8 || PRI_MACROS_BROKEN
+ # undef SCNd8
+ # define SCNd8 "hhd"
+ #endif
+ #if !defined SCNi8 || PRI_MACROS_BROKEN
+ # undef SCNi8
+ # define SCNi8 "hhi"
+ #endif
+ #if !defined SCNo8 || PRI_MACROS_BROKEN
+ # undef SCNo8
+ # define SCNo8 "hho"
+ #endif
+ #if !defined SCNu8 || PRI_MACROS_BROKEN
+ # undef SCNu8
+ # define SCNu8 "hhu"
+ #endif
+ #if !defined SCNx8 || PRI_MACROS_BROKEN
+ # undef SCNx8
+ # define SCNx8 "hhx"
+ #endif
+ #if !defined SCNX8 || PRI_MACROS_BROKEN
+ # undef SCNX8
+ # define SCNX8 "hhX"
+ #endif
+ #if !defined SCNd16 || PRI_MACROS_BROKEN
+ # undef SCNd16
+ # define SCNd16 "hd"
+ #endif
+ #if !defined SCNi16 || PRI_MACROS_BROKEN
+ # undef SCNi16
+ # define SCNi16 "hi"
+ #endif
+ #if !defined SCNo16 || PRI_MACROS_BROKEN
+ # undef SCNo16
+ # define SCNo16 "ho"
+ #endif
+ #if !defined SCNu16 || PRI_MACROS_BROKEN
+ # undef SCNu16
+ # define SCNu16 "hu"
+ #endif
+ #if !defined SCNx16 || PRI_MACROS_BROKEN
+ # undef SCNx16
+ # define SCNx16 "hx"
+ #endif
+ #if !defined SCNX16 || PRI_MACROS_BROKEN
+ # undef SCNX16
+ # define SCNX16 "hX"
+ #endif
+ #if !defined SCNd32 || PRI_MACROS_BROKEN
+ # undef SCNd32
+ # define SCNd32 "d"
+ #endif
+ #if !defined SCNi32 || PRI_MACROS_BROKEN
+ # undef SCNi32
+ # define SCNi32 "i"
+ #endif
+ #if !defined SCNo32 || PRI_MACROS_BROKEN
+ # undef SCNo32
+ # define SCNo32 "o"
+ #endif
+ #if !defined SCNu32 || PRI_MACROS_BROKEN
+ # undef SCNu32
+ # define SCNu32 "u"
+ #endif
+ #if !defined SCNx32 || PRI_MACROS_BROKEN
+ # undef SCNx32
+ # define SCNx32 "x"
+ #endif
+ #if !defined SCNX32 || PRI_MACROS_BROKEN
+ # undef SCNX32
+ # define SCNX32 "X"
+ #endif
+ #ifdef INT64_MAX
+ # if INT64_MAX == LONG_MAX
+ # define _SCN64_PREFIX "l"
+ # elif defined _MSC_VER || defined __MINGW32__
+ # define _SCN64_PREFIX "I64"
+ # elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+ # define _SCN64_PREFIX "ll"
+ # endif
+ # if !defined SCNd64 || PRI_MACROS_BROKEN
+ # undef SCNd64
+ # define SCNd64 _SCN64_PREFIX "d"
+ # endif
+ # if !defined SCNi64 || PRI_MACROS_BROKEN
+ # undef SCNi64
+ # define SCNi64 _SCN64_PREFIX "i"
+ # endif
+ #endif
+ #ifdef UINT64_MAX
+ # if INT64_MAX == LONG_MAX
+ # define _SCNu64_PREFIX "l"
+ # elif defined _MSC_VER || defined __MINGW32__
+ # define _SCNu64_PREFIX "I64"
+ # elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+ # define _SCNu64_PREFIX "ll"
+ # endif
+ # if !defined SCNo64 || PRI_MACROS_BROKEN
+ # undef SCNo64
+ # define SCNo64 _SCNu64_PREFIX "o"
+ # endif
+ # if !defined SCNu64 || PRI_MACROS_BROKEN
+ # undef SCNu64
+ # define SCNu64 _SCNu64_PREFIX "u"
+ # endif
+ # if !defined SCNx64 || PRI_MACROS_BROKEN
+ # undef SCNx64
+ # define SCNx64 _SCNu64_PREFIX "x"
+ # endif
+ # if !defined SCNX64 || PRI_MACROS_BROKEN
+ # undef SCNX64
+ # define SCNX64 _SCNu64_PREFIX "X"
+ # endif
+ #endif
+
+ #if !defined SCNdLEAST8 || PRI_MACROS_BROKEN
+ # undef SCNdLEAST8
+ # define SCNdLEAST8 "hhd"
+ #endif
+ #if !defined SCNiLEAST8 || PRI_MACROS_BROKEN
+ # undef SCNiLEAST8
+ # define SCNiLEAST8 "hhi"
+ #endif
+ #if !defined SCNoLEAST8 || PRI_MACROS_BROKEN
+ # undef SCNoLEAST8
+ # define SCNoLEAST8 "hho"
+ #endif
+ #if !defined SCNuLEAST8 || PRI_MACROS_BROKEN
+ # undef SCNuLEAST8
+ # define SCNuLEAST8 "hhu"
+ #endif
+ #if !defined SCNxLEAST8 || PRI_MACROS_BROKEN
+ # undef SCNxLEAST8
+ # define SCNxLEAST8 "hhx"
+ #endif
+ #if !defined SCNXLEAST8 || PRI_MACROS_BROKEN
+ # undef SCNXLEAST8
+ # define SCNXLEAST8 "hhX"
+ #endif
+ #if !defined SCNdLEAST16 || PRI_MACROS_BROKEN
+ # undef SCNdLEAST16
+ # define SCNdLEAST16 "hd"
+ #endif
+ #if !defined SCNiLEAST16 || PRI_MACROS_BROKEN
+ # undef SCNiLEAST16
+ # define SCNiLEAST16 "hi"
+ #endif
+ #if !defined SCNoLEAST16 || PRI_MACROS_BROKEN
+ # undef SCNoLEAST16
+ # define SCNoLEAST16 "ho"
+ #endif
+ #if !defined SCNuLEAST16 || PRI_MACROS_BROKEN
+ # undef SCNuLEAST16
+ # define SCNuLEAST16 "hu"
+ #endif
+ #if !defined SCNxLEAST16 || PRI_MACROS_BROKEN
+ # undef SCNxLEAST16
+ # define SCNxLEAST16 "hx"
+ #endif
+ #if !defined SCNXLEAST16 || PRI_MACROS_BROKEN
+ # undef SCNXLEAST16
+ # define SCNXLEAST16 "hX"
+ #endif
+ #if !defined SCNdLEAST32 || PRI_MACROS_BROKEN
+ # undef SCNdLEAST32
+ # define SCNdLEAST32 "d"
+ #endif
+ #if !defined SCNiLEAST32 || PRI_MACROS_BROKEN
+ # undef SCNiLEAST32
+ # define SCNiLEAST32 "i"
+ #endif
+ #if !defined SCNoLEAST32 || PRI_MACROS_BROKEN
+ # undef SCNoLEAST32
+ # define SCNoLEAST32 "o"
+ #endif
+ #if !defined SCNuLEAST32 || PRI_MACROS_BROKEN
+ # undef SCNuLEAST32
+ # define SCNuLEAST32 "u"
+ #endif
+ #if !defined SCNxLEAST32 || PRI_MACROS_BROKEN
+ # undef SCNxLEAST32
+ # define SCNxLEAST32 "x"
+ #endif
+ #if !defined SCNXLEAST32 || PRI_MACROS_BROKEN
+ # undef SCNXLEAST32
+ # define SCNXLEAST32 "X"
+ #endif
+ #ifdef INT64_MAX
+ # if !defined SCNdLEAST64 || PRI_MACROS_BROKEN
+ # undef SCNdLEAST64
+ # define SCNdLEAST64 SCNd64
+ # endif
+ # if !defined SCNiLEAST64 || PRI_MACROS_BROKEN
+ # undef SCNiLEAST64
+ # define SCNiLEAST64 SCNi64
+ # endif
+ #endif
+ #ifdef UINT64_MAX
+ # if !defined SCNoLEAST64 || PRI_MACROS_BROKEN
+ # undef SCNoLEAST64
+ # define SCNoLEAST64 SCNo64
+ # endif
+ # if !defined SCNuLEAST64 || PRI_MACROS_BROKEN
+ # undef SCNuLEAST64
+ # define SCNuLEAST64 SCNu64
+ # endif
+ # if !defined SCNxLEAST64 || PRI_MACROS_BROKEN
+ # undef SCNxLEAST64
+ # define SCNxLEAST64 SCNx64
+ # endif
+ # if !defined SCNXLEAST64 || PRI_MACROS_BROKEN
+ # undef SCNXLEAST64
+ # define SCNXLEAST64 SCNX64
+ # endif
+ #endif
+
+ #if !defined SCNdFAST8 || PRI_MACROS_BROKEN
+ # undef SCNdFAST8
+ # if INT_FAST8_MAX > INT32_MAX
+ # define SCNdFAST8 SCNd64
+ # elif INT_FAST8_MAX == 0x7fff
+ # define SCNdFAST8 "hd"
+ # elif INT_FAST8_MAX == 0x7f
+ # define SCNdFAST8 "hhd"
+ # else
+ # define SCNdFAST8 "d"
+ # endif
+ #endif
+ #if !defined SCNiFAST8 || PRI_MACROS_BROKEN
+ # undef SCNiFAST8
+ # if INT_FAST8_MAX > INT32_MAX
+ # define SCNiFAST8 SCNi64
+ # elif INT_FAST8_MAX == 0x7fff
+ # define SCNiFAST8 "hi"
+ # elif INT_FAST8_MAX == 0x7f
+ # define SCNiFAST8 "hhi"
+ # else
+ # define SCNiFAST8 "i"
+ # endif
+ #endif
+ #if !defined SCNoFAST8 || PRI_MACROS_BROKEN
+ # undef SCNoFAST8
+ # if UINT_FAST8_MAX > UINT32_MAX
+ # define SCNoFAST8 SCNo64
+ # elif UINT_FAST8_MAX == 0xffff
+ # define SCNoFAST8 "ho"
+ # elif UINT_FAST8_MAX == 0xff
+ # define SCNoFAST8 "hho"
+ # else
+ # define SCNoFAST8 "o"
+ # endif
+ #endif
+ #if !defined SCNuFAST8 || PRI_MACROS_BROKEN
+ # undef SCNuFAST8
+ # if UINT_FAST8_MAX > UINT32_MAX
+ # define SCNuFAST8 SCNu64
+ # elif UINT_FAST8_MAX == 0xffff
+ # define SCNuFAST8 "hu"
+ # elif UINT_FAST8_MAX == 0xff
+ # define SCNuFAST8 "hhu"
+ # else
+ # define SCNuFAST8 "u"
+ # endif
+ #endif
+ #if !defined SCNxFAST8 || PRI_MACROS_BROKEN
+ # undef SCNxFAST8
+ # if UINT_FAST8_MAX > UINT32_MAX
+ # define SCNxFAST8 SCNx64
+ # elif UINT_FAST8_MAX == 0xffff
+ # define SCNxFAST8 "hx"
+ # elif UINT_FAST8_MAX == 0xff
+ # define SCNxFAST8 "hhx"
+ # else
+ # define SCNxFAST8 "x"
+ # endif
+ #endif
+ #if !defined SCNXFAST8 || PRI_MACROS_BROKEN
+ # undef SCNXFAST8
+ # if UINT_FAST8_MAX > UINT32_MAX
+ # define SCNXFAST8 SCNX64
+ # elif UINT_FAST8_MAX == 0xffff
+ # define SCNXFAST8 "hX"
+ # elif UINT_FAST8_MAX == 0xff
+ # define SCNXFAST8 "hhX"
+ # else
+ # define SCNXFAST8 "X"
+ # endif
+ #endif
+ #if !defined SCNdFAST16 || PRI_MACROS_BROKEN
+ # undef SCNdFAST16
+ # if INT_FAST16_MAX > INT32_MAX
+ # define SCNdFAST16 SCNd64
+ # elif INT_FAST16_MAX == 0x7fff
+ # define SCNdFAST16 "hd"
+ # else
+ # define SCNdFAST16 "d"
+ # endif
+ #endif
+ #if !defined SCNiFAST16 || PRI_MACROS_BROKEN
+ # undef SCNiFAST16
+ # if INT_FAST16_MAX > INT32_MAX
+ # define SCNiFAST16 SCNi64
+ # elif INT_FAST16_MAX == 0x7fff
+ # define SCNiFAST16 "hi"
+ # else
+ # define SCNiFAST16 "i"
+ # endif
+ #endif
+ #if !defined SCNoFAST16 || PRI_MACROS_BROKEN
+ # undef SCNoFAST16
+ # if UINT_FAST16_MAX > UINT32_MAX
+ # define SCNoFAST16 SCNo64
+ # elif UINT_FAST16_MAX == 0xffff
+ # define SCNoFAST16 "ho"
+ # else
+ # define SCNoFAST16 "o"
+ # endif
+ #endif
+ #if !defined SCNuFAST16 || PRI_MACROS_BROKEN
+ # undef SCNuFAST16
+ # if UINT_FAST16_MAX > UINT32_MAX
+ # define SCNuFAST16 SCNu64
+ # elif UINT_FAST16_MAX == 0xffff
+ # define SCNuFAST16 "hu"
+ # else
+ # define SCNuFAST16 "u"
+ # endif
+ #endif
+ #if !defined SCNxFAST16 || PRI_MACROS_BROKEN
+ # undef SCNxFAST16
+ # if UINT_FAST16_MAX > UINT32_MAX
+ # define SCNxFAST16 SCNx64
+ # elif UINT_FAST16_MAX == 0xffff
+ # define SCNxFAST16 "hx"
+ # else
+ # define SCNxFAST16 "x"
+ # endif
+ #endif
+ #if !defined SCNXFAST16 || PRI_MACROS_BROKEN
+ # undef SCNXFAST16
+ # if UINT_FAST16_MAX > UINT32_MAX
+ # define SCNXFAST16 SCNX64
+ # elif UINT_FAST16_MAX == 0xffff
+ # define SCNXFAST16 "hX"
+ # else
+ # define SCNXFAST16 "X"
+ # endif
+ #endif
+ #if !defined SCNdFAST32 || PRI_MACROS_BROKEN
+ # undef SCNdFAST32
+ # if INT_FAST32_MAX > INT32_MAX
+ # define SCNdFAST32 SCNd64
+ # else
+ # define SCNdFAST32 "d"
+ # endif
+ #endif
+ #if !defined SCNiFAST32 || PRI_MACROS_BROKEN
+ # undef SCNiFAST32
+ # if INT_FAST32_MAX > INT32_MAX
+ # define SCNiFAST32 SCNi64
+ # else
+ # define SCNiFAST32 "i"
+ # endif
+ #endif
+ #if !defined SCNoFAST32 || PRI_MACROS_BROKEN
+ # undef SCNoFAST32
+ # if UINT_FAST32_MAX > UINT32_MAX
+ # define SCNoFAST32 SCNo64
+ # else
+ # define SCNoFAST32 "o"
+ # endif
+ #endif
+ #if !defined SCNuFAST32 || PRI_MACROS_BROKEN
+ # undef SCNuFAST32
+ # if UINT_FAST32_MAX > UINT32_MAX
+ # define SCNuFAST32 SCNu64
+ # else
+ # define SCNuFAST32 "u"
+ # endif
+ #endif
+ #if !defined SCNxFAST32 || PRI_MACROS_BROKEN
+ # undef SCNxFAST32
+ # if UINT_FAST32_MAX > UINT32_MAX
+ # define SCNxFAST32 SCNx64
+ # else
+ # define SCNxFAST32 "x"
+ # endif
+ #endif
+ #if !defined SCNXFAST32 || PRI_MACROS_BROKEN
+ # undef SCNXFAST32
+ # if UINT_FAST32_MAX > UINT32_MAX
+ # define SCNXFAST32 SCNX64
+ # else
+ # define SCNXFAST32 "X"
+ # endif
+ #endif
+ #ifdef INT64_MAX
+ # if !defined SCNdFAST64 || PRI_MACROS_BROKEN
+ # undef SCNdFAST64
+ # define SCNdFAST64 SCNd64
+ # endif
+ # if !defined SCNiFAST64 || PRI_MACROS_BROKEN
+ # undef SCNiFAST64
+ # define SCNiFAST64 SCNi64
+ # endif
+ #endif
+ #ifdef UINT64_MAX
+ # if !defined SCNoFAST64 || PRI_MACROS_BROKEN
+ # undef SCNoFAST64
+ # define SCNoFAST64 SCNo64
+ # endif
+ # if !defined SCNuFAST64 || PRI_MACROS_BROKEN
+ # undef SCNuFAST64
+ # define SCNuFAST64 SCNu64
+ # endif
+ # if !defined SCNxFAST64 || PRI_MACROS_BROKEN
+ # undef SCNxFAST64
+ # define SCNxFAST64 SCNx64
+ # endif
+ # if !defined SCNXFAST64 || PRI_MACROS_BROKEN
+ # undef SCNXFAST64
+ # define SCNXFAST64 SCNX64
+ # endif
+ #endif
+
+ #if !defined SCNdMAX || PRI_MACROS_BROKEN
+ # undef SCNdMAX
+ # if INTMAX_MAX > INT32_MAX
+ # define SCNdMAX SCNd64
+ # else
+ # define SCNdMAX "ld"
+ # endif
+ #endif
+ #if !defined SCNiMAX || PRI_MACROS_BROKEN
+ # undef SCNiMAX
+ # if INTMAX_MAX > INT32_MAX
+ # define SCNiMAX SCNi64
+ # else
+ # define SCNiMAX "li"
+ # endif
+ #endif
+ #if !defined SCNoMAX || PRI_MACROS_BROKEN
+ # undef SCNoMAX
+ # if UINTMAX_MAX > UINT32_MAX
+ # define SCNoMAX SCNo64
+ # else
+ # define SCNoMAX "lo"
+ # endif
+ #endif
+ #if !defined SCNuMAX || PRI_MACROS_BROKEN
+ # undef SCNuMAX
+ # if UINTMAX_MAX > UINT32_MAX
+ # define SCNuMAX SCNu64
+ # else
+ # define SCNuMAX "lu"
+ # endif
+ #endif
+ #if !defined SCNxMAX || PRI_MACROS_BROKEN
+ # undef SCNxMAX
+ # if UINTMAX_MAX > UINT32_MAX
+ # define SCNxMAX SCNx64
+ # else
+ # define SCNxMAX "lx"
+ # endif
+ #endif
+ #if !defined SCNXMAX || PRI_MACROS_BROKEN
+ # undef SCNXMAX
+ # if UINTMAX_MAX > UINT32_MAX
+ # define SCNXMAX SCNX64
+ # else
+ # define SCNXMAX "lX"
+ # endif
+ #endif
+
+ #if !defined SCNdPTR || PRI_MACROS_BROKEN
+ # undef SCNdPTR
+ # define SCNdPTR @PRIPTR_PREFIX@ "d"
+ #endif
+ #if !defined SCNiPTR || PRI_MACROS_BROKEN
+ # undef SCNiPTR
+ # define SCNiPTR @PRIPTR_PREFIX@ "i"
+ #endif
+ #if !defined SCNoPTR || PRI_MACROS_BROKEN
+ # undef SCNoPTR
+ # define SCNoPTR @PRIPTR_PREFIX@ "o"
+ #endif
+ #if !defined SCNuPTR || PRI_MACROS_BROKEN
+ # undef SCNuPTR
+ # define SCNuPTR @PRIPTR_PREFIX@ "u"
+ #endif
+ #if !defined SCNxPTR || PRI_MACROS_BROKEN
+ # undef SCNxPTR
+ # define SCNxPTR @PRIPTR_PREFIX@ "x"
+ #endif
+ #if !defined SCNXPTR || PRI_MACROS_BROKEN
+ # undef SCNXPTR
+ # define SCNXPTR @PRIPTR_PREFIX@ "X"
+ #endif
+
+ /* 7.8.2 Functions for greatest-width integer types */
+
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
+ #if address@hidden@
+ extern intmax_t imaxabs (intmax_t);
+ #endif
+
+ #if address@hidden@
+ typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
+ extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
+ #endif
+
+ #if address@hidden@
+ extern intmax_t strtoimax (const char *, char **, int);
+ #endif
+ #if address@hidden@
+ extern uintmax_t strtoumax (const char *, char **, int);
+ #endif
+
+ /* Don't bother defining or declaring wcstoimax and wcstoumax, since
+ wide-character functions like this are hardly useful. */
+
+ #ifdef __cplusplus
+ }
+ #endif
+
+ #endif /* INTTYPES_H */
diff -r -c3 --unidirectional-new-file --exclude=CVS
gnulib-20060722/m4/inttypes.m4 gnulib-20060722-modified/m4/inttypes.m4
*** gnulib-20060722/m4/inttypes.m4 1970-01-01 01:00:00.000000000 +0100
--- gnulib-20060722-modified/m4/inttypes.m4 2006-07-23 03:23:38.000000000
+0200
***************
*** 0 ****
--- 1,237 ----
+ # inttypes.m4 serial 2
+ dnl Copyright (C) 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.
+
+ dnl From Derek Price, Bruno Haible.
+ dnl Test whether <inttypes.h> is supported or must be substituted.
+
+ AC_DEFUN([gl_INTTYPES_H],
+ [
+ AC_REQUIRE([gl_STDINT_H])
+ AC_REQUIRE([gt_INTTYPES_PRI])
+ AC_REQUIRE([gl_INCLUDE_NEXT])
+ AC_CHECK_DECLS_ONCE([imaxabs])
+ AC_CHECK_DECLS_ONCE([imaxdiv])
+ AC_CHECK_DECLS_ONCE([strtoimax])
+ AC_CHECK_DECLS_ONCE([strtoumax])
+
+ dnl Now see if we need a substitute <inttypes.h>.
+ gl_cv_header_working_inttypes_h=no
+ if test $gl_cv_header_inttypes_h = yes; then
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([
+ #include <stddef.h>
+ #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
+ #include ABSOLUTE_INTTYPES_H
+
+ /* Same tests as in stdint.m4. */
+
+ #ifdef INT8_MAX
+ int8_t a1 = INT8_MAX;
+ #endif
+ #ifdef INT16_MAX
+ int16_t a2 = INT16_MAX;
+ #endif
+ #ifdef INT32_MAX
+ int32_t a3 = INT32_MAX;
+ #endif
+ #ifdef INT64_MAX
+ int64_t a4 = INT64_MAX;
+ #endif
+ #ifdef UINT8_MAX
+ uint8_t b1 = UINT8_MAX;
+ #else
+ typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
+ #endif
+ #ifdef UINT16_MAX
+ uint16_t b2 = UINT16_MAX;
+ #endif
+ #ifdef UINT32_MAX
+ uint32_t b3 = UINT32_MAX;
+ #endif
+ #ifdef UINT64_MAX
+ uint64_t b4 = UINT64_MAX;
+ #endif
+ int_least8_t c1 = INT8_C (0x7f);
+ int_least16_t c2 = INT16_C (0x7fff);
+ int_least32_t c3 = INT32_C (0x7fffffff);
+ int_least64_t c4 = INT64_C (0x7fffffffffffffff);
+ uint_least8_t d1 = UINT8_C (0xff);
+ uint_least16_t d2 = UINT16_C (0xffff);
+ uint_least32_t d3 = UINT32_C (0xffffffff);
+ uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
+ int_fast8_t e1 = INT_FAST8_MAX;
+ int_fast16_t e2 = INT_FAST16_MAX;
+ int_fast32_t e3 = INT_FAST32_MAX;
+ int_fast64_t e4 = INT_FAST64_MAX;
+ uint_fast8_t f1 = UINT_FAST8_MAX;
+ uint_fast16_t f2 = UINT_FAST16_MAX;
+ uint_fast32_t f3 = UINT_FAST32_MAX;
+ uint_fast64_t f4 = UINT_FAST64_MAX;
+ #ifdef INTPTR_MAX
+ intptr_t g = INTPTR_MAX;
+ #endif
+ #ifdef UINTPTR_MAX
+ uintptr_t h = UINTPTR_MAX;
+ #endif
+ intmax_t i = INTMAX_MAX;
+ uintmax_t j = UINTMAX_MAX;
+ struct s {
+ int check_PTRDIFF: PTRDIFF_MIN < 0 && 0 < PTRDIFF_MAX ? 1 : -1;
+ int check_SIG_ATOMIC: SIG_ATOMIC_MIN <= 0 && 0 < SIG_ATOMIC_MAX ? 1 : -1;
+ int check_SIZE: 0 < SIZE_MAX ? 1 : -1;
+ int check_WCHAR: WCHAR_MIN <= 0 && 0 < WCHAR_MAX ? 1 : -1;
+ int check_WINT: WINT_MIN <= 0 && 0 < WINT_MAX ? 1 : -1;
+
+ /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
+ int check_UINT8_C:
+ (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
+ int check_UINT16_C:
+ (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
+
+ /* Detect bugs in OpenBSD 3.9 stdint.h. */
+ #ifdef UINT8_MAX
+ int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
+ #endif
+ #ifdef UINT16_MAX
+ int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
+ #endif
+ #ifdef UINT32_MAX
+ int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
+ #endif
+ #ifdef UINT64_MAX
+ int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
+ #endif
+ int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
+ int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
+ int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
+ int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
+ int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
+ int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
+ int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
+ int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
+ int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
+ int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
+ int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
+ };
+
+ /* Tests for macros supposed to be defined in inttypes.h. */
+
+ const char *k = /* implicit string concatenation */
+ PRId8 PRIi8 PRIo8 PRIu8 PRIx8 PRIX8
+ PRId16 PRIi16 PRIo16 PRIu16 PRIx16 PRIX16
+ PRId32 PRIi32 PRIo32 PRIu32 PRIx32 PRIX32
+ #ifdef INT64_MAX
+ PRId64 PRIi64
+ #endif
+ #ifdef UINT64_MAX
+ PRIo64 PRIu64 PRIx64 PRIX64
+ #endif
+ PRIdLEAST8 PRIiLEAST8 PRIoLEAST8 PRIuLEAST8 PRIxLEAST8 PRIXLEAST8
+ PRIdLEAST16 PRIiLEAST16 PRIoLEAST16 PRIuLEAST16 PRIxLEAST16 PRIXLEAST16
+ PRIdLEAST32 PRIiLEAST32 PRIoLEAST32 PRIuLEAST32 PRIxLEAST32 PRIXLEAST32
+ PRIdLEAST64 PRIiLEAST64
+ PRIoLEAST64 PRIuLEAST64 PRIxLEAST64 PRIXLEAST64
+ PRIdFAST8 PRIiFAST8 PRIoFAST8 PRIuFAST8 PRIxFAST8 PRIXFAST8
+ PRIdFAST16 PRIiFAST16 PRIoFAST16 PRIuFAST16 PRIxFAST16 PRIXFAST16
+ PRIdFAST32 PRIiFAST32 PRIoFAST32 PRIuFAST32 PRIxFAST32 PRIXFAST32
+ PRIdFAST64 PRIiFAST64
+ PRIoFAST64 PRIuFAST64 PRIxFAST64 PRIXFAST64
+ PRIdMAX PRIiMAX PRIoMAX PRIuMAX PRIxMAX PRIXMAX
+ PRIdPTR PRIiPTR PRIoPTR PRIuPTR PRIxPTR PRIXPTR
+ ;
+ const char *l = /* implicit string concatenation */
+ SCNd8 SCNi8 SCNo8 SCNu8 SCNx8 SCNX8
+ SCNd16 SCNi16 SCNo16 SCNu16 SCNx16 SCNX16
+ SCNd32 SCNi32 SCNo32 SCNu32 SCNx32 SCNX32
+ #ifdef INT64_MAX
+ SCNd64 SCNi64
+ #endif
+ #ifdef UINT64_MAX
+ SCNo64 SCNu64 SCNx64 SCNX64
+ #endif
+ SCNdLEAST8 SCNiLEAST8 SCNoLEAST8 SCNuLEAST8 SCNxLEAST8 SCNXLEAST8
+ SCNdLEAST16 SCNiLEAST16 SCNoLEAST16 SCNuLEAST16 SCNxLEAST16 SCNXLEAST16
+ SCNdLEAST32 SCNiLEAST32 SCNoLEAST32 SCNuLEAST32 SCNxLEAST32 SCNXLEAST32
+ SCNdLEAST64 SCNiLEAST64
+ SCNoLEAST64 SCNuLEAST64 SCNxLEAST64 SCNXLEAST64
+ SCNdFAST8 SCNiFAST8 SCNoFAST8 SCNuFAST8 SCNxFAST8 SCNXFAST8
+ SCNdFAST16 SCNiFAST16 SCNoFAST16 SCNuFAST16 SCNxFAST16 SCNXFAST16
+ SCNdFAST32 SCNiFAST32 SCNoFAST32 SCNuFAST32 SCNxFAST32 SCNXFAST32
+ SCNdFAST64 SCNiFAST64
+ SCNoFAST64 SCNuFAST64 SCNxFAST64 SCNXFAST64
+ SCNdMAX SCNiMAX SCNoMAX SCNuMAX SCNxMAX SCNXMAX
+ SCNdPTR SCNiPTR SCNoPTR SCNuPTR SCNxPTR SCNXPTR
+ ;
+ ])],
+ [if test $gl_cv_header_working_stdint_h = yes \
+ && test "$ac_cv_have_decl_imaxabs" = yes \
+ && test "$ac_cv_have_decl_imaxdiv" = yes \
+ && test "$ac_cv_have_decl_strtoimax" = yes \
+ && test "$ac_cv_have_decl_strtoumax" = yes; then
+ gl_cv_header_working_inttypes_h=yes
+ fi
+ ])
+ fi
+ if test $gl_cv_header_working_inttypes_h = yes; then
+ dnl Use the existing <inttypes.h>.
+ INTTYPES_H=''
+ else
+
+ PRIPTR_PREFIX=
+ if test -n "$STDINT_H"; then
+ dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'.
+ PRIPTR_PREFIX='"l"'
+ else
+ dnl Using the system's <stdint.h>.
+ for glpfx in '' l ll I64; do
+ case $glpfx in
+ '') gltype1='int';;
+ l) gltype1='long int';;
+ ll) gltype1='long long int';;
+ I64) gltype1='__int64';;
+ esac
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([#include <stdint.h>
+ extern intptr_t foo;
+ extern $gltype1 foo;])],
+ [PRIPTR_PREFIX='"'$glpfx'"'])
+ test -n "$PRIPTR_PREFIX" && break
+ done
+ fi
+ AC_SUBST([PRIPTR_PREFIX])
+
+ if test "$ac_cv_have_decl_imaxabs" = yes; then
+ HAVE_DECL_IMAXABS=1
+ else
+ HAVE_DECL_IMAXABS=0
+ fi
+ AC_SUBST([HAVE_DECL_IMAXABS])
+
+ if test "$ac_cv_have_decl_imaxdiv" = yes; then
+ HAVE_DECL_IMAXDIV=1
+ else
+ HAVE_DECL_IMAXDIV=0
+ fi
+ AC_SUBST([HAVE_DECL_IMAXDIV])
+
+ if test "$ac_cv_have_decl_strtoimax" = yes; then
+ HAVE_DECL_STRTOIMAX=1
+ else
+ HAVE_DECL_STRTOIMAX=0
+ fi
+ AC_SUBST([HAVE_DECL_STRTOIMAX])
+
+ if test "$ac_cv_have_decl_strtoumax" = yes; then
+ HAVE_DECL_STRTOUMAX=1
+ else
+ HAVE_DECL_STRTOUMAX=0
+ fi
+ AC_SUBST([HAVE_DECL_STRTOUMAX])
+
+ INTTYPES_H='inttypes.h'
+ fi
+ AC_SUBST(INTTYPES_H)
+ ])
diff -r -c3 --unidirectional-new-file --exclude=CVS
gnulib-20060722/lib/stdint_.h gnulib-20060722-modified/lib/stdint_.h
*** gnulib-20060722/lib/stdint_.h 2006-07-05 19:37:40.000000000 +0200
--- gnulib-20060722-modified/lib/stdint_.h 2006-07-23 01:53:20.000000000
+0200
***************
*** 62,68 ****
/* 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>
#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.
*/
--- 62,68 ----
/* 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 @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 -r -c3 --unidirectional-new-file --exclude=CVS
gnulib-20060722/m4/stdint.m4 gnulib-20060722-modified/m4/stdint.m4
*** gnulib-20060722/m4/stdint.m4 2006-07-11 13:54:20.000000000 +0200
--- gnulib-20060722-modified/m4/stdint.m4 2006-07-23 03:00:45.000000000
+0200
***************
*** 1,4 ****
! # stdint.m4 serial 15
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,
--- 1,4 ----
! # stdint.m4 serial 16
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,41 ****
--- 32,45 ----
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 -r -c3 --unidirectional-new-file --exclude=CVS
gnulib-20060722/modules/stdint gnulib-20060722-modified/modules/stdint
*** gnulib-20060722/modules/stdint 2006-07-05 19:37:40.000000000 +0200
--- gnulib-20060722-modified/modules/stdint 2006-07-23 01:55:10.000000000
+0200
***************
*** 26,34 ****
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_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' \
--- 26,35 ----
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|@''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' \
diff -r -c3 --unidirectional-new-file --exclude=CVS
gnulib-20060722/modules/imaxabs gnulib-20060722-modified/modules/imaxabs
*** gnulib-20060722/modules/imaxabs 1970-01-01 01:00:00.000000000 +0100
--- gnulib-20060722-modified/modules/imaxabs 2006-06-05 23:09:29.000000000
+0200
***************
*** 0 ****
--- 1,23 ----
+ Description:
+ imaxabs() function: absolute value of 'intmax_t'.
+
+ Files:
+ lib/imaxabs.c
+ m4/imaxabs.m4
+
+ Depends-on:
+ inttypes
+
+ configure.ac:
+ gl_FUNC_IMAXABS
+
+ Makefile.am:
+
+ Include:
+ <inttypes.h>
+
+ License:
+ LGPL
+
+ Maintainer:
+ Bruno Haible
diff -r -c3 --unidirectional-new-file --exclude=CVS
gnulib-20060722/lib/imaxabs.c gnulib-20060722-modified/lib/imaxabs.c
*** gnulib-20060722/lib/imaxabs.c 1970-01-01 01:00:00.000000000 +0100
--- gnulib-20060722-modified/lib/imaxabs.c 2006-06-05 23:41:42.000000000
+0200
***************
*** 0 ****
--- 1,29 ----
+ /* imaxabs() function: absolute value of 'intmax_t'.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ 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 2, 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, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+ /* Specification. */
+ #include <inttypes.h>
+
+ intmax_t
+ imaxabs (intmax_t x)
+ {
+ return (x >= 0 ? x : - x);
+ }
diff -r -c3 --unidirectional-new-file --exclude=CVS
gnulib-20060722/m4/imaxabs.m4 gnulib-20060722-modified/m4/imaxabs.m4
*** gnulib-20060722/m4/imaxabs.m4 1970-01-01 01:00:00.000000000 +0100
--- gnulib-20060722-modified/m4/imaxabs.m4 2006-06-05 23:15:40.000000000
+0200
***************
*** 0 ****
--- 1,17 ----
+ # imaxabs.m4 serial 1
+ dnl Copyright (C) 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.
+
+ AC_DEFUN([gl_FUNC_IMAXABS],
+ [
+ AC_REQUIRE([gl_INTTYPES_H])
+ if test "$ac_cv_have_decl_imaxabs" != yes; then
+ AC_LIBOBJ([imaxabs])
+ gl_PREREQ_IMAXABS
+ fi
+ ])
+
+ # Prerequisites of lib/imaxabs.c.
+ AC_DEFUN([gl_PREREQ_IMAXABS], [:])
diff -r -c3 --unidirectional-new-file --exclude=CVS
gnulib-20060722/modules/imaxdiv gnulib-20060722-modified/modules/imaxdiv
*** gnulib-20060722/modules/imaxdiv 1970-01-01 01:00:00.000000000 +0100
--- gnulib-20060722-modified/modules/imaxdiv 2006-06-05 23:09:30.000000000
+0200
***************
*** 0 ****
--- 1,23 ----
+ Description:
+ imaxdiv() function: division of 'intmax_t'.
+
+ Files:
+ lib/imaxdiv.c
+ m4/imaxdiv.m4
+
+ Depends-on:
+ inttypes
+
+ configure.ac:
+ gl_FUNC_IMAXDIV
+
+ Makefile.am:
+
+ Include:
+ <inttypes.h>
+
+ License:
+ LGPL
+
+ Maintainer:
+ Bruno Haible
diff -r -c3 --unidirectional-new-file --exclude=CVS
gnulib-20060722/lib/imaxdiv.c gnulib-20060722-modified/lib/imaxdiv.c
*** gnulib-20060722/lib/imaxdiv.c 1970-01-01 01:00:00.000000000 +0100
--- gnulib-20060722-modified/lib/imaxdiv.c 2006-06-06 00:00:44.000000000
+0200
***************
*** 0 ****
--- 1,51 ----
+ /* imaxdiv() function: division of 'intmax_t'.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ 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 2, 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, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+ /* Specification. */
+ #include <inttypes.h>
+
+ #include <stdlib.h>
+
+ imaxdiv_t
+ imaxdiv (intmax_t numer, intmax_t denom)
+ {
+ imaxdiv_t result;
+
+ result.quot = numer / denom;
+ result.rem = numer % denom;
+
+ /* Verify the requirements of ISO C 99 section 6.5.5 paragraph 6:
+ "When integers are divided, the result of the / operator is the
+ algebraic quotient with any fractional part discarded. (This is
+ often called "truncation toward zero".) If the quotient a/b is
+ representable, the expression (a/b)*b + a%b shall equal a." */
+ if (!(denom == 0 || (denom == -1 && numer < 0 && - numer < 0)))
+ {
+ if (!(result.quot * denom + result.rem == numer))
+ abort ();
+ if (!(numer >= 0
+ ? result.rem >= 0 && result.rem < (denom >= 0 ? denom : - denom)
+ : result.rem <= 0 && result.rem > (denom >= 0 ? - denom : denom)))
+ abort ();
+ }
+
+ return result;
+ }
diff -r -c3 --unidirectional-new-file --exclude=CVS
gnulib-20060722/m4/imaxdiv.m4 gnulib-20060722-modified/m4/imaxdiv.m4
*** gnulib-20060722/m4/imaxdiv.m4 1970-01-01 01:00:00.000000000 +0100
--- gnulib-20060722-modified/m4/imaxdiv.m4 2006-06-05 23:15:53.000000000
+0200
***************
*** 0 ****
--- 1,17 ----
+ # imaxdiv.m4 serial 1
+ dnl Copyright (C) 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.
+
+ AC_DEFUN([gl_FUNC_IMAXDIV],
+ [
+ AC_REQUIRE([gl_INTTYPES_H])
+ if test "$ac_cv_have_decl_imaxdiv" != yes; then
+ AC_LIBOBJ([imaxdiv])
+ gl_PREREQ_IMAXDIV
+ fi
+ ])
+
+ # Prerequisites of lib/imaxdiv.c.
+ AC_DEFUN([gl_PREREQ_IMAXDIV], [:])
- rewritten inttypes module,
Bruno Haible <=