This is another prerequisite for libstdc++.
2013-05-26 Joern Rennecke <joern.renne...@embecosm.com>
* include/stdint.h [!__USING_MINT8] (UINT8_MAX): Provide (signed) int value. (SIZE_MAX): Define as UINT16_MAX. [!WCHAR_MAX] (WCHAR_MAX, WCHAR_MIN): Define. [!WINT_MAX] (WINT_MAX, WINT_MIN): Define. diff --git a/avr-libc/include/stdint.h b/avr-libc/include/stdint.h index f18cd48..1b00fba 100644 --- a/avr-libc/include/stdint.h +++ b/avr-libc/include/stdint.h @@ -1,6 +1,7 @@ /* Copyright (c) 2002,2004,2005 Marek Michalkiewicz Copyright (c) 2005, Carlos Lamas Copyright (c) 2005,2007 Joerg Wunsch + Copyright (c) 2013 Embecosm All rights reserved. Redistribution and use in source and binary forms, with or without @@ -304,13 +304,10 @@ typedef uint64_t uintmax_t; #define INT8_MIN (-INT8_MAX - 1) -/** \ingroup avr_stdint - largest value an uint8_t can hold. */ +#if __USING_MINT8 #define UINT8_MAX (__CONCAT(INT8_MAX, U) * 2U + 1U) -#if __USING_MINT8 - #define INT16_MAX 0x7fffL #define INT16_MIN (-INT16_MAX - 1L) #define UINT16_MAX (__CONCAT(INT16_MAX, U) * 2UL + 1UL) @@ -322,6 +319,11 @@ typedef uint64_t uintmax_t; #else /* !__USING_MINT8 */ /** \ingroup avr_stdint + largest value an uint8_t can hold. */ + +#define UINT8_MAX (INT8_MAX * 2 + 1) + +/** \ingroup avr_stdint largest positive value an int16_t can hold. */ #define INT16_MAX 0x7fff @@ -577,7 +579,7 @@ typedef uint64_t uintmax_t; /** \ingroup avr_stdint largest value a size_t can hold. */ -#define SIZE_MAX (__CONCAT(INT16_MAX, U)) +#define SIZE_MAX UINT16_MAX /* Limits of wchar_t */ @@ -588,8 +590,14 @@ typedef uint64_t uintmax_t; /* Limits of wint_t */ /* wchar.h is currently not implemented */ -/* #define WINT_MAX */ -/* #define WINT_MIN */ +#ifndef WCHAR_MAX +#define WCHAR_MAX __WCHAR_MAX__ +#define WCHAR_MIN __WCHAR_MIN__ +#endif +#ifndef WINT_MAX +#define WINT_MAX __WINT_MAX__ +#define WINT_MIN __WINT_MIN__ +#endif #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
_______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-libc-dev