aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2024-11-16 22:12:05 +0100
committerGeorg-Johann Lay <avr@gjlay.de>2024-11-16 22:18:51 +0100
commit307b11179aeeab3a837ea287a5557763e99f6f89 (patch)
treeb9df60f3be14c16170b78f7603622a492d7de355 /libgcc
parentb085fc9965b7d1e99725892587682822068f2baa (diff)
downloadgcc-307b11179aeeab3a837ea287a5557763e99f6f89.zip
gcc-307b11179aeeab3a837ea287a5557763e99f6f89.tar.gz
gcc-307b11179aeeab3a837ea287a5557763e99f6f89.tar.bz2
AVR: Fix building LibF7 after switching to C23.
Since r15-5327, GNU-C23 is being used as C language default. libf7.h doesn't assume headers like stdbool.h are present and defines bool, true and false on its own. libgcc/config/avr/libf7/ * libf7.h (bool, true, false): Don't define in C23 or higher.
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/config/avr/libf7/libf7.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/libgcc/config/avr/libf7/libf7.h b/libgcc/config/avr/libf7/libf7.h
index 38ee270..7226c0e 100644
--- a/libgcc/config/avr/libf7/libf7.h
+++ b/libgcc/config/avr/libf7/libf7.h
@@ -95,12 +95,16 @@ typedef __INT64_TYPE__ int64_t;
typedef __INT32_TYPE__ int32_t;
typedef __INT16_TYPE__ int16_t;
typedef __INT8_TYPE__ int8_t;
-typedef _Bool bool;
-#define false 0
-#define true 1
#define INT8_MIN (-1 - __INT8_MAX__)
#define INT16_MAX __INT16_MAX__
#define NULL ((void*) 0)
+#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
+/* bool, true and false are keywords. */
+#else
+#define bool _Bool
+#define true 1
+#define false 0
+#endif /* C23 ? */
#endif /* IN_LIBGCC2 */
#include "asm-defs.h"