From b19fc38e5e8e57f5df399e972edbc5968b5b16b3 Mon Sep 17 00:00:00 2001 From: Roger Clark Date: Fri, 26 May 2017 17:00:47 +1000 Subject: [PATCH] Applied change to fix issue in itoa.c and itoa.h with newer versions of GCC (using the changes from STM's fix, in Arduino_Core_STM32) --- STM32F1/cores/maple/itoa.c | 6 +++++- STM32F1/cores/maple/itoa.h | 5 +++++ STM32F4/cores/maple/itoa.c | 6 +++++- STM32F4/cores/maple/itoa.h | 5 +++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/STM32F1/cores/maple/itoa.c b/STM32F1/cores/maple/itoa.c index fc35766..ee74f82 100644 --- a/STM32F1/cores/maple/itoa.c +++ b/STM32F1/cores/maple/itoa.c @@ -120,8 +120,12 @@ extern char* ltoa( long value, char *string, int radix ) return string; } - +#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 9 || \ + (__GNUC_MINOR__ == 9 && __GNUC_PATCHLEVEL__ > 2))) +extern char* utoa( unsigned value, char *string, int radix ) +#else extern char* utoa( unsigned long value, char *string, int radix ) +#endif { return ultoa( value, string, radix ) ; } diff --git a/STM32F1/cores/maple/itoa.h b/STM32F1/cores/maple/itoa.h index 59af109..b88204c 100644 --- a/STM32F1/cores/maple/itoa.h +++ b/STM32F1/cores/maple/itoa.h @@ -31,7 +31,12 @@ extern void itoa( int n, char s[] ) ; extern char* itoa( int value, char *string, int radix ) ; extern char* ltoa( long value, char *string, int radix ) ; +#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 9 || \ + (__GNUC_MINOR__ == 9 && __GNUC_PATCHLEVEL__ > 2))) +extern char* utoa( unsigned value, char *string, int radix ) ; +#else extern char* utoa( unsigned long value, char *string, int radix ) ; +#endif extern char* ultoa( unsigned long value, char *string, int radix ) ; #endif /* 0 */ diff --git a/STM32F4/cores/maple/itoa.c b/STM32F4/cores/maple/itoa.c index fc35766..ee74f82 100644 --- a/STM32F4/cores/maple/itoa.c +++ b/STM32F4/cores/maple/itoa.c @@ -120,8 +120,12 @@ extern char* ltoa( long value, char *string, int radix ) return string; } - +#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 9 || \ + (__GNUC_MINOR__ == 9 && __GNUC_PATCHLEVEL__ > 2))) +extern char* utoa( unsigned value, char *string, int radix ) +#else extern char* utoa( unsigned long value, char *string, int radix ) +#endif { return ultoa( value, string, radix ) ; } diff --git a/STM32F4/cores/maple/itoa.h b/STM32F4/cores/maple/itoa.h index 59af109..b88204c 100644 --- a/STM32F4/cores/maple/itoa.h +++ b/STM32F4/cores/maple/itoa.h @@ -31,7 +31,12 @@ extern void itoa( int n, char s[] ) ; extern char* itoa( int value, char *string, int radix ) ; extern char* ltoa( long value, char *string, int radix ) ; +#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 9 || \ + (__GNUC_MINOR__ == 9 && __GNUC_PATCHLEVEL__ > 2))) +extern char* utoa( unsigned value, char *string, int radix ) ; +#else extern char* utoa( unsigned long value, char *string, int radix ) ; +#endif extern char* ultoa( unsigned long value, char *string, int radix ) ; #endif /* 0 */