Skip to content

Commit 9dd8703

Browse files
committed
Support building with gcc 4.9.3 or later
Port of arduino/Arduino#4830
1 parent 897532f commit 9dd8703

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

cores/arduino/itoa.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,14 @@ extern char* ltoa( long value, char *string, int radix )
122122
return string;
123123
}
124124

125+
#if __GNUC__ > 4 || \
126+
(__GNUC__ == 4 && (__GNUC_MINOR__ > 9 || \
127+
(__GNUC_MINOR__ == 9 && \
128+
__GNUC_PATCHLEVEL__ > 2)))
129+
extern char* utoa( unsigned value, char *string, int radix )
130+
#else
125131
extern char* utoa( unsigned long value, char *string, int radix )
132+
#endif
126133
{
127134
return ultoa( value, string, radix ) ;
128135
}

cores/arduino/itoa.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@ extern "C"{
2626

2727
extern char* itoa( int value, char *string, int radix ) ;
2828
extern char* ltoa( long value, char *string, int radix ) ;
29+
#if __GNUC__ > 4 || \
30+
(__GNUC__ == 4 && (__GNUC_MINOR__ > 9 || \
31+
(__GNUC_MINOR__ == 9 && \
32+
__GNUC_PATCHLEVEL__ > 2)))
33+
extern char* utoa( unsigned value, char *string, int radix ) ;
34+
#else
2935
extern char* utoa( unsigned long value, char *string, int radix ) ;
36+
#endif
3037
extern char* ultoa( unsigned long value, char *string, int radix ) ;
3138

3239
#ifdef __cplusplus

0 commit comments

Comments
 (0)