Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / third_party / pigweed / repo / pw_arduino_build / py / pw_arduino_build / core_patches / teensy / 01-teensyduino_1.53-cpp17.diff
1 diff --git a/teensy3/WCharacter.h b/teensy3/WCharacter.h
2 index 5bfe697..7c500c1 100644
3 --- a/teensy3/WCharacter.h
4 +++ b/teensy3/WCharacter.h
5 @@ -61,7 +61,7 @@ inline boolean isAlpha(int c)
6  // that fits into the ASCII character set.
7  inline boolean isAscii(int c)
8  {
9 -  return ( isascii (c) == 0 ? false : true);
10 +  return ((c & ~0x7F) != 0 ? false : true);
11  }
12  
13  
14 @@ -143,7 +143,7 @@ inline boolean isHexadecimalDigit(int c)
15  // ASCII character set, by clearing the high-order bits.
16  inline int toAscii(int c)
17  {
18 -  return toascii (c);
19 +  return (c & 0x7F);
20  }
21  
22  
23 diff --git a/teensy3/avr_functions.h b/teensy3/avr_functions.h
24 index 977c5e9..55c426c 100644
25 --- a/teensy3/avr_functions.h
26 +++ b/teensy3/avr_functions.h
27 @@ -95,7 +95,7 @@ static inline void eeprom_update_block(const void *buf, void *addr, uint32_t len
28  char * ultoa(unsigned long val, char *buf, int radix);
29  char * ltoa(long val, char *buf, int radix);
30  
31 -#if defined(_NEWLIB_VERSION) && (__NEWLIB__ < 2 || __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 2)
32 +#if defined(__STRICT_ANSI__) || (defined(_NEWLIB_VERSION) && (__NEWLIB__ < 2 || __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 2))
33  static inline char * utoa(unsigned int val, char *buf, int radix) __attribute__((always_inline, unused));
34  static inline char * utoa(unsigned int val, char *buf, int radix) { return ultoa(val, buf, radix); }
35  static inline char * itoa(int val, char *buf, int radix) __attribute__((always_inline, unused));
36 diff --git a/teensy4/WCharacter.h b/teensy4/WCharacter.h
37 index 5bfe697..7c500c1 100644
38 --- a/teensy4/WCharacter.h
39 +++ b/teensy4/WCharacter.h
40 @@ -61,7 +61,7 @@ inline boolean isAlpha(int c)
41  // that fits into the ASCII character set.
42  inline boolean isAscii(int c)
43  {
44 -  return ( isascii (c) == 0 ? false : true);
45 +  return ((c & ~0x7F) != 0 ? false : true);
46  }
47  
48  
49 @@ -143,7 +143,7 @@ inline boolean isHexadecimalDigit(int c)
50  // ASCII character set, by clearing the high-order bits.
51  inline int toAscii(int c)
52  {
53 -  return toascii (c);
54 +  return (c & 0x7F);
55  }
56  
57  
58 diff --git a/teensy4/avr_functions.h b/teensy4/avr_functions.h
59 index fb6ca11..3b34391 100644
60 --- a/teensy4/avr_functions.h
61 +++ b/teensy4/avr_functions.h
62 @@ -97,7 +97,7 @@ static inline void eeprom_update_block(const void *buf, void *addr, uint32_t len
63  char * ultoa(unsigned long val, char *buf, int radix);
64  char * ltoa(long val, char *buf, int radix);
65  
66 -#if defined(_NEWLIB_VERSION) && (__NEWLIB__ < 2 || __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 2)
67 +#if defined(__STRICT_ANSI__) || (defined(_NEWLIB_VERSION) && (__NEWLIB__ < 2 || __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 2))
68  static inline char * utoa(unsigned int val, char *buf, int radix) __attribute__((always_inline, unused));
69  static inline char * utoa(unsigned int val, char *buf, int radix) { return ultoa(val, buf, radix); }
70  static inline char * itoa(int val, char *buf, int radix) __attribute__((always_inline, unused));