From e7ab8899cd31959623320e339d16296fdbf44136 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Mon, 1 Nov 2004 11:38:18 +0000 Subject: 2004-11-01 Ralf Corsepius * configure.ac: Remove -ansi (Cygwin breaks with it). * libcsupport/include/stdint.h: Use sys/_stdint.h to setup fixed size types. * libcsupport/include/sys/_inttypes.h: Add SCN*N macros. --- cpukit/ChangeLog | 7 ++ cpukit/configure.ac | 2 +- cpukit/libcsupport/include/stdint.h | 18 +---- cpukit/libcsupport/include/sys/_inttypes.h | 110 +++++++++++++++++++++++++++++ 4 files changed, 119 insertions(+), 18 deletions(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index bab43154ee..45afef6b00 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,10 @@ +2004-11-01 Ralf Corsepius + + * configure.ac: Remove -ansi (Cygwin breaks with it). + * libcsupport/include/stdint.h: Use sys/_stdint.h to setup fixed + size types. + * libcsupport/include/sys/_inttypes.h: Add SCN*N macros. + 2004-11-01 Ralf Corsepius * libcsupport/src/utsname.c: Revert yesterdays patch. diff --git a/cpukit/configure.ac b/cpukit/configure.ac index 66cc319eb7..fef551717d 100644 --- a/cpukit/configure.ac +++ b/cpukit/configure.ac @@ -31,7 +31,7 @@ else AC_MSG_ERROR(no) fi -RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]) +RTEMS_PROG_CC_FOR_TARGET([-fasm]) RTEMS_PROG_CCAS RTEMS_CANONICALIZE_TOOLS AM_PROG_CC_C_O diff --git a/cpukit/libcsupport/include/stdint.h b/cpukit/libcsupport/include/stdint.h index 9720cfbba0..1277aae4be 100644 --- a/cpukit/libcsupport/include/stdint.h +++ b/cpukit/libcsupport/include/stdint.h @@ -13,23 +13,7 @@ extern "C" { #endif -#include - -/* - * map RTEMS internal types onto C99 types - */ -typedef signed8 int8_t; -typedef signed16 int16_t; -typedef signed32 int32_t; -typedef signed64 int64_t; - -typedef unsigned8 uint8_t; -typedef unsigned16 uint16_t; -typedef unsigned32 uint32_t; -typedef unsigned64 uint64_t; - -typedef signed long intptr_t; -typedef unsigned long uintptr_t; +#include #ifdef __cplusplus } diff --git a/cpukit/libcsupport/include/sys/_inttypes.h b/cpukit/libcsupport/include/sys/_inttypes.h index ec903af2cf..8e2bac8a66 100644 --- a/cpukit/libcsupport/include/sys/_inttypes.h +++ b/cpukit/libcsupport/include/sys/_inttypes.h @@ -18,6 +18,8 @@ /* 8-bit types */ #define __PRI8(x) __STRINGIFY(x) +#define __SCN8(x) __STRINGIFY(hh##x) + #define PRId8 __PRI8(d) #define PRIi8 __PRI8(i) @@ -26,6 +28,13 @@ #define PRIx8 __PRI8(x) #define PRIX8 __PRI8(X) +#define SCNd8 __SCN8(d) +#define SCNi8 __SCN8(i) +#define SCNo8 __SCN8(o) +#define SCNu8 __SCN8(u) +#define SCNx8 __SCN8(x) + + #define PRIdLEAST8 __PRI8(d) #define PRIiLEAST8 __PRI8(i) #define PRIoLEAST8 __PRI8(o) @@ -33,6 +42,13 @@ #define PRIxLEAST8 __PRI8(x) #define PRIXLEAST8 __PRI8(X) +#define SCNdLEAST8 __SCN8(d) +#define SCNiLEAST8 __SCN8(i) +#define SCNoLEAST8 __SCN8(o) +#define SCNuLEAST8 __SCN8(u) +#define SCNxLEAST8 __SCN8(x) + + #define PRIdFAST8 __PRI8(d) #define PRIiFAST8 __PRI8(i) #define PRIoFAST8 __PRI8(o) @@ -40,8 +56,16 @@ #define PRIxFAST8 __PRI8(x) #define PRIXFAST8 __PRI8(X) +#define SCNdFAST8 __SCN8(d) +#define SCNiFAST8 __SCN8(i) +#define SCNoFAST8 __SCN8(o) +#define SCNuFAST8 __SCN8(u) +#define SCNxFAST8 __SCN8(x) + /* 16-bit types */ #define __PRI16(x) __STRINGIFY(x) +#define __SCN16(x) __STRINGIFY(h##x) + #define PRId16 __PRI16(d) #define PRIi16 __PRI16(i) @@ -50,6 +74,13 @@ #define PRIx16 __PRI16(x) #define PRIX16 __PRI16(X) +#define SCNd16 __SCN16(d) +#define SCNi16 __SCN16(i) +#define SCNo16 __SCN16(o) +#define SCNu16 __SCN16(u) +#define SCNx16 __SCN16(x) + + #define PRIdLEAST16 __PRI16(d) #define PRIiLEAST16 __PRI16(i) #define PRIoLEAST16 __PRI16(o) @@ -57,6 +88,13 @@ #define PRIxLEAST16 __PRI16(x) #define PRIXLEAST16 __PRI16(X) +#define SCNdLEAST16 __SCN16(d) +#define SCNiLEAST16 __SCN16(i) +#define SCNoLEAST16 __SCN16(o) +#define SCNuLEAST16 __SCN16(u) +#define SCNxLEAST16 __SCN16(x) + + #define PRIdFAST16 __PRI16(d) #define PRIiFAST16 __PRI16(i) #define PRIoFAST16 __PRI16(o) @@ -64,11 +102,19 @@ #define PRIxFAST16 __PRI16(x) #define PRIXFAST16 __PRI16(X) +#define SCNdFAST16 __SCN16(d) +#define SCNiFAST16 __SCN16(i) +#define SCNoFAST16 __SCN16(o) +#define SCNuFAST16 __SCN16(u) +#define SCNxFAST16 __SCN16(x) + /* 32-bit types */ #if defined(__rtems_long32) #define __PRI32(x) __STRINGIFY(l##x) +#define __SCN32(x) __STRINGIFY(l##x) #else #define __PRI32(x) __STRINGIFY(x) +#define __SCN32(x) __STRINGIFY(x) #endif #define PRId32 __PRI32(d) @@ -78,6 +124,13 @@ #define PRIx32 __PRI32(x) #define PRIX32 __PRI32(X) +#define SCNd32 __SCN32(d) +#define SCNi32 __SCN32(i) +#define SCNo32 __SCN32(o) +#define SCNu32 __SCN32(u) +#define SCNx32 __SCN32(x) + + #define PRIdLEAST32 __PRI32(d) #define PRIiLEAST32 __PRI32(i) #define PRIoLEAST32 __PRI32(o) @@ -85,6 +138,13 @@ #define PRIxLEAST32 __PRI32(x) #define PRIXLEAST32 __PRI32(X) +#define SCNdLEAST32 __SCN32(d) +#define SCNiLEAST32 __SCN32(i) +#define SCNoLEAST32 __SCN32(o) +#define SCNuLEAST32 __SCN32(u) +#define SCNxLEAST32 __SCN32(x) + + #define PRIdFAST32 __PRI32(d) #define PRIiFAST32 __PRI32(i) #define PRIoFAST32 __PRI32(o) @@ -92,13 +152,23 @@ #define PRIxFAST32 __PRI32(x) #define PRIXFAST32 __PRI32(X) +#define SCNdFAST32 __SCN32(d) +#define SCNiFAST32 __SCN32(i) +#define SCNoFAST32 __SCN32(o) +#define SCNuFAST32 __SCN32(u) +#define SCNxFAST32 __SCN32(x) + + /* 64-bit types */ #if defined(__rtems_longlong64) #define __PRI64(x) __STRINGIFY(ll##x) +#define __SCN64(x) __STRINGIFY(ll##x) #elif defined(__rtems_long64) #define __PRI64(x) __STRINGIFY(l##x) +#define __SCN64(x) __STRINGIFY(l##x) #else #define __PRI64(x) __STRINGIFY(x) +#define __SCN64(x) __STRINGIFY(x) #endif #define PRId64 __PRI64(d) @@ -108,6 +178,13 @@ #define PRIx64 __PRI64(x) #define PRIX64 __PRI64(X) +#define SCNd64 __SCN64(d) +#define SCNi64 __SCN64(i) +#define SCNo64 __SCN64(o) +#define SCNu64 __SCN64(u) +#define SCNx64 __SCN64(x) + + #define PRIdLEAST64 __PRI64(d) #define PRIiLEAST64 __PRI64(i) #define PRIoLEAST64 __PRI64(o) @@ -115,6 +192,13 @@ #define PRIxLEAST64 __PRI64(x) #define PRIXLEAST64 __PRI64(X) +#define SCNdLEAST64 __SCN64(d) +#define SCNiLEAST64 __SCN64(i) +#define SCNoLEAST64 __SCN64(o) +#define SCNuLEAST64 __SCN64(u) +#define SCNxLEAST64 __SCN64(x) + + #define PRIdFAST64 __PRI64(d) #define PRIiFAST64 __PRI64(i) #define PRIoFAST64 __PRI64(o) @@ -122,13 +206,23 @@ #define PRIxFAST64 __PRI64(x) #define PRIXFAST64 __PRI64(X) +#define SCNdFAST64 __SCN64(d) +#define SCNiFAST64 __SCN64(i) +#define SCNoFAST64 __SCN64(o) +#define SCNuFAST64 __SCN64(u) +#define SCNxFAST64 __SCN64(x) + + /* max-bit types */ #if defined(__rtems_longlong64) #define __PRIMAX(x) __STRINGIFY(ll##x) +#define __SCNMAX(x) __STRINGIFY(ll##x) #elif defined(__rtems_long64) #define __PRIMAX(x) __STRINGIFY(l##x) +#define __SCNMAX(x) __STRINGIFY(l##x) #else #define __PRIMAX(x) __STRINGIFY(x) +#define __SCNMAX(x) __STRINGIFY(x) #endif #define PRIdMAX __PRIMAX(d) @@ -138,13 +232,22 @@ #define PRIxMAX __PRIMAX(x) #define PRIXMAX __PRIMAX(X) +#define SCNdMAX __SCNMAX(d) +#define SCNiMAX __SCNMAX(i) +#define SCNoMAX __SCNMAX(o) +#define SCNuMAX __SCNMAX(u) +#define SCNxMAX __SCNMAX(x) + /* ptr types */ #if defined(__rtems_longlong64) #define __PRIPTR(x) __STRINGIFY(ll##x) +#define __SCNPTR(x) __STRINGIFY(ll##x) #elif defined(__rtems_long64) #define __PRIPTR(x) __STRINGIFY(l##x) +#define __SCNPTR(x) __STRINGIFY(l##x) #else #define __PRIPTR(x) __STRINGIFY(x) +#define __SCNPTR(x) __STRINGIFY(x) #endif #define PRIdPTR __PRIPTR(d) @@ -154,6 +257,13 @@ #define PRIxPTR __PRIPTR(x) #define PRIXPTR __PRIPTR(X) +#define SCNdPTR __SCNPTR(d) +#define SCNiPTR __SCNPTR(i) +#define SCNoPTR __SCNPTR(o) +#define SCNuPTR __SCNPTR(u) +#define SCNxPTR __SCNPTR(x) + + typedef struct { intmax_t quot; intmax_t rem; -- cgit v1.2.3