2004-09-10 Theodore A. Roth * include/stdint.h (__HAS_INT32_T__): Define if gcc can supply us with a 32 bit integer. (__HAS_INT64_T__): Define if gcc can supply us with a 64 bit integer. * include/avr/pgmspace.h (prog_int32_t): Use __HAS_INT32_T__ when typedef'ing. (prog_uint32_t): Ditto. (prog_int64_t): Use __HAS_INT64_T__ when typedef'ing. (prog_uint64_t): Ditto. Index: include/stdint.h =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/include/stdint.h,v retrieving revision 1.1 diff -u -p -p -r1.1 stdint.h --- include/stdint.h 22 Jul 2004 20:42:54 -0000 1.1 +++ include/stdint.h 10 Sep 2004 21:49:43 -0000 @@ -64,15 +64,23 @@ typedef signed char int8_t; typedef unsigned char uint8_t; +/* When you use the -mint8 gcc option, you get either int32_t or int64_t, but + not both. */ + +#define __HAS_INT32_T__ 1 +#define __HAS_INT64_T__ 1 + #if __USING_MINT8 typedef long int16_t; typedef unsigned long uint16_t; #if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 5) +# undef __HAS_INT64_T__ typedef long long int32_t; typedef unsigned long long uint32_t; #else +# undef __HAS_INT32_T__ typedef long long int64_t; typedef unsigned long long uint64_t; #endif Index: include/avr/pgmspace.h =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/include/avr/pgmspace.h,v retrieving revision 1.21 diff -u -p -p -r1.21 pgmspace.h --- include/avr/pgmspace.h 10 Sep 2004 21:20:53 -0000 1.21 +++ include/avr/pgmspace.h 10 Sep 2004 21:49:43 -0000 @@ -95,12 +95,14 @@ typedef int8_t prog_int8_t PROGMEM; typedef uint8_t prog_uint8_t PROGMEM; typedef int16_t prog_int16_t PROGMEM; typedef uint16_t prog_uint16_t PROGMEM; -#if !defined(__USING_MINT8) +#if defined(__HAS_INT32_T__) typedef int32_t prog_int32_t PROGMEM; typedef uint32_t prog_uint32_t PROGMEM; #endif +#if defined(__HAS_INT64_T__) typedef int64_t prog_int64_t PROGMEM; typedef uint64_t prog_uint64_t PROGMEM; +#endif /* Although in C, we can get away with just using __c, it does not work in C++. We need to use &__c[0] to avoid the compiler puking. Dave Hylands