From 07a984b1ada22813e3bac131711a9c2cf89611bd Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Thu, 4 Nov 2004 21:48:12 +0000 Subject: 2004-11-04 Ralf Corsepius * include/sys/_stdint.h: Various changes. Add *leastN_t types. Add INTN_{MIN|MAX} macros. Add doxygen preamble. * include/sys/_inttypes.h: Add doxygen preamble. Reflect changes above. * libcsupport/include/stdint.h: Add doxygen preamble. * libcsupport/include/inttypes.h: Add doxygen preamble. * configure.ac: Add doxygen preamble to cpuopts.h. --- cpukit/libcsupport/include/inttypes.h | 6 +- cpukit/libcsupport/include/stdint.h | 6 +- cpukit/libcsupport/include/sys/_inttypes.h | 8 +- cpukit/libcsupport/include/sys/_stdint.h | 153 +++++++++++++++++++++++++---- 4 files changed, 149 insertions(+), 24 deletions(-) (limited to 'cpukit/libcsupport') diff --git a/cpukit/libcsupport/include/inttypes.h b/cpukit/libcsupport/include/inttypes.h index 87e1798f17..376a93f379 100644 --- a/cpukit/libcsupport/include/inttypes.h +++ b/cpukit/libcsupport/include/inttypes.h @@ -1,6 +1,8 @@ +/** + * @file inttypes.h + */ + /* - * inttypes.h - * * ISO C99 Format conversion of integer types. * * $Id$ diff --git a/cpukit/libcsupport/include/stdint.h b/cpukit/libcsupport/include/stdint.h index 1277aae4be..34cc7032fe 100644 --- a/cpukit/libcsupport/include/stdint.h +++ b/cpukit/libcsupport/include/stdint.h @@ -1,6 +1,8 @@ +/** + * @file stdint.h + */ + /* - * stdint.h - * * ISO C99 integer types * * $Id$ diff --git a/cpukit/libcsupport/include/sys/_inttypes.h b/cpukit/libcsupport/include/sys/_inttypes.h index 8e2bac8a66..6f14db3cfe 100644 --- a/cpukit/libcsupport/include/sys/_inttypes.h +++ b/cpukit/libcsupport/include/sys/_inttypes.h @@ -1,3 +1,7 @@ +/** + * @file sys/_inttypes.h + */ + /* * COPYRIGHT (c) 2004. * Ralf Corsepius, Ulm/Germany. @@ -184,7 +188,7 @@ #define SCNu64 __SCN64(u) #define SCNx64 __SCN64(x) - +#if __int64_t_defined #define PRIdLEAST64 __PRI64(d) #define PRIiLEAST64 __PRI64(i) #define PRIoLEAST64 __PRI64(o) @@ -211,7 +215,7 @@ #define SCNoFAST64 __SCN64(o) #define SCNuFAST64 __SCN64(u) #define SCNxFAST64 __SCN64(x) - +#endif /* max-bit types */ #if defined(__rtems_longlong64) diff --git a/cpukit/libcsupport/include/sys/_stdint.h b/cpukit/libcsupport/include/sys/_stdint.h index a960fe15eb..901e135989 100644 --- a/cpukit/libcsupport/include/sys/_stdint.h +++ b/cpukit/libcsupport/include/sys/_stdint.h @@ -1,3 +1,7 @@ +/** + * @file sys/_stdint.h + */ + /* * COPYRIGHT (c) 2004. * Ralf Corsepius, Ulm/Germany. @@ -27,60 +31,117 @@ extern "C" { #if __EXP(SCHAR_MAX) == 0x7f typedef signed char int8_t ; typedef unsigned char uint8_t ; -#define int8_t_defined 1 +#define __int8_t_defined 1 +#endif +#if __int8_t_defined typedef signed char int_least8_t; typedef unsigned char uint_least8_t; -#define int_least8_t_defined 1 +#define __int_least8_t_defined 1 #endif -#if __EXP(INT_MAX) == 0x7fff -typedef signed int int16_t; -typedef unsigned int uint16_t; -#define int16_t_defined 1 -#elif __EXP(SHRT_MAX) == 0x7fff +#if __EXP(SHRT_MAX) == 0x7fff typedef signed short int16_t; typedef unsigned short uint16_t; -#define int16_t_defined 1 +#define __int16_t_defined 1 +#elif __EXP(INT_MAX) == 0x7fff +typedef signed int int16_t; +typedef unsigned int uint16_t; +#define __int16_t_defined 1 #elif __EXP(SCHAR_MAX) == 0x7fff -typedef signed char int32_t; -typedef unsigned char uint32_t; -#define int16_t_defined 1 +typedef signed char int16_t; +typedef unsigned char uint16_t; +#define __int16_t_defined 1 +#endif + +#if __int16_t_defined +typedef int16_t int_least16_t; +typedef uint16_t uint_least16_t; +#define __int_least16_t_defined 1 + +#ifndef __int_least8_t_defined +typedef int16_t int_least8_t; +typedef uint16_t uint_least8_t; +#define __int_least8_t_defined 1 +#endif #endif #if __EXP(INT_MAX) == 0x7fffffffL typedef signed int int32_t; typedef unsigned int uint32_t; -#define int32_t_defined 1 +#define __int32_t_defined 1 #elif __EXP(LONG_MAX) == 0x7fffffffL typedef signed long int32_t; typedef unsigned long uint32_t; -#define int32_t_defined 1 +#define __int32_t_defined 1 #define __rtems_long32 1 #elif __EXP(SHRT_MAX) == 0x7fffffffL typedef signed short int32_t; typedef unsigned short uint32_t; -#define int32_t_defined 1 +#define __int32_t_defined 1 #elif __EXP(SCHAR_MAX) == 0x7fffffffL typedef signed char int32_t; typedef unsigned char uint32_t; -#define int32_t_defined 1 +#define INT32_C(x) x +#define __int32_t_defined 1 +#endif + +#if __int32_t_defined +typedef int32_t int_least32_t; +typedef uint32_t uint_least32_t; +#define __int_least32_t_defined 1 + +#ifndef __int_least8_t_defined +typedef int32_t int_least8_t; +typedef uint32_t uint_least8_t; +#define __int_least8_t_defined 1 +#endif + +#ifndef __int_least16_t_defined +typedef int32_t int_least16_t; +typedef uint32_t uint_least16_t; +#define __int_least16_t_defined 1 +#endif #endif #if __EXP(LONG_MAX) > 0x7fffffff typedef signed long int64_t; typedef unsigned long uint64_t; -#define int64_t_defined 1 +#define __int64_t_defined 1 #define __rtems_long64 1 #elif __EXP(LONG_LONG_MAX) > 0x7fffffff typedef signed long long int64_t; typedef unsigned long long uint64_t; -#define int64_t_defined 1 +#define __int64_t_defined 1 #define __rtems_longlong64 1 #elif __EXP(INT_MAX) > 0x7fffffff typedef signed int int64_t; typedef unsigned int uint64_t; -#define int64_t_defined 1 +#define __int64_t_defined 1 +#endif + +#if __int64_t_defined +typedef int64_t int_least64_t; +typedef uint64_t uint_least64_t; +#define __int_least64_t_defined 1 + +#ifndef __int_least8_t_defined +typedef int64_t int_least8_t; +typedef uint64_t uint_least8_t; +#define __int_least8_t_defined 1 +#endif + +#ifndef __int_least16_t_defined +typedef int64_t int_least16_t; +typedef uint64_t uint_least16_t; +#define __int_least16_t_defined 1 +#endif + +#ifndef __int_least32_t_defined +typedef int64_t int_least32_t; +typedef uint64_t uint_least32_t; +#define __int_least32_t_defined 1 +#endif #endif #if __rtems_longlong64 @@ -94,6 +155,62 @@ typedef unsigned long uintmax_t; typedef signed long intptr_t; typedef unsigned long uintptr_t; +/* Limits of Specified-Width Integer Types */ + +#if __int8_t_defined +#define INT8_MIN -128 +#define INT8_MAX 127 +#define UINT8_MAX 255 +#endif + +#if __int_least8_t_defined +#define INTLEAST8_MIN -128 +#define INTLEAST8_MAX 127 +#define UINTLEAST8_MAX 255 +#else +#error required type int_least8_t missing +#endif + +#if __int16_t_defined +#define INT16_MIN -32768 +#define INT16_MAX 32767 +#define UINT16_MAX 65535 +#endif + +#if __int_least16_t_defined +#define INTLEAST16_MIN -32768 +#define INTLEAST16_MAX 32767 +#define UINTLEAST16_MAX 65535 +#else +#error required type int_least16_t missing +#endif + +#if __int32_t_defined +#define INT32_MIN -2147483648 +#define INT32_MAX 2147483647 +#define UINT32_MAX 4294967295 +#endif + +#if __int_least32_t_defined +#define INTLEAST32_MIN -2147483648 +#define INTLEAST32_MAX 2147483647 +#define UINTLEAST32_MAX 4294967295 +#else +#error required type int_least32_t missing +#endif + +#if __int64_t_defined +#define INT64_MIN -9223372036854775808 +#define INT64_MAX 9223372036854775807 +#define UINT64_MAX 18446744073709551615 +#endif + +#if __int_least64_t_defined +#define INTLEAST64_MIN -9223372036854775808 +#define INTLEAST64_MAX 9223372036854775807 +#define UINTLEAST64_MAX 18446744073709551615 +#endif + #undef __EXP #ifdef __cplusplus -- cgit v1.2.3