view modules/stdint @ 27159:894f1eb63cd6

Port to Tandem NSK OSS, which has 64-bit signed int but at most 32-bit unsigned int. Problem reported by Matthew Woehlke in: http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00062.html More generally, don't assume that 64-bit signed int is available if unsigned int is, and vice versa. * lib/inttypes_.h (_PRIu64_PREFIX, _SCNu64_PREFIX): Depend on unsigned symbols, not on their signed counterparts. * lib/stdint_.h (uint64_t, uint_least64_t, uint_fast64_t, uintmax_t): (UINT64_MAX, UINT_LEAST64_MAX, UINT_FAST64_MAX, UINTMAX_MAX): (UINT64_C, UINTMAX_C): Likewise. * lib/strtoimax.c (strtoll): Depend on signed symbols, not their unsigned counterparts. (Have_long_long, Unsigned): New macros. (Int): Renamed from INT. (strtoimax): Use the new macros. * m4/stdint.m4 (gl_STDINT_H): Require AC_TYPE_UNSIGNED_LONG_LONG_INT and substitute HAVE_UNSIGNED_LONG_LONG_INT. * modules/inttypes (inttypes.h): Substitute HAVE_UNSIGNED_LONG_LONG_INT. * modules/stdint (stdint.h): Likewise. (Files): Add m4/ulonglong.m4.
author Paul Eggert <eggert@cs.ucla.edu>
date Wed, 11 Oct 2006 05:58:47 +0000
parents 499aa823eee7
children 6a764f23e302
line wrap: on
line source

Description:
A <stdint.h> that nearly conforms to C99.
Assumes typical host with 8-bit bytes, two's complement
representation, and no padding or trap representations, with int
widths equal to 8, 16, 32, and 64 bits.  {uint,int}_fast{8,16,32,64}_t
may not correspond to the fastest types available on the system.
Macros are used instead of typedefs.

Files:
lib/stdint_.h
m4/stdint.m4
m4/absolute-header.m4
m4/longlong.m4
m4/ulonglong.m4

Depends-on:

configure.ac:
gl_STDINT_H

Makefile.am:
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 $@
	{ 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

Include:
#include <stdint.h>

License:
LGPL

Maintainer:
all