Skip to content

Commit 29dd014

Browse files
jeremybettisdkalowsk
authored andcommitted
toolchain: llvm: Use clang's __INTN_C/__UINTN_C macros for clang 20.1+
Use the builtin intn macros for 20.1+, as 20.0 doesn't include them. 20.0 wasn't an official release. Signed-off-by: Jeremy Bettis <[email protected]>
1 parent b2c37e0 commit 29dd014

File tree

1 file changed

+3
-3
lines changed
  • include/zephyr/toolchain

1 file changed

+3
-3
lines changed

include/zephyr/toolchain/llvm.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
#ifdef CONFIG_MINIMAL_LIBC
4343

4444
/*
45-
* Predefined __INTN_C/__UINTN_C macros are provided by clang starting in version 20.
45+
* Predefined __INTN_C/__UINTN_C macros are provided by clang starting in version 20.1.
4646
* Avoid redefining these macros if a sufficiently modern clang is being used.
4747
*/
48-
#if __clang_major__ < 20
48+
#if TOOLCHAIN_CLANG_VERSION < 200100
4949

5050
#define __int_c(v, suffix) v ## suffix
5151
#define int_c(v, suffix) __int_c(v, suffix)
@@ -138,7 +138,7 @@
138138
#define __INTMAX_C(x) int_c(x, __INTMAX_C_SUFFIX__)
139139
#define __UINTMAX_C(x) int_c(x, __UINTMAX_C_SUFFIX__)
140140

141-
#endif /* __clang_major__ < 20 */
141+
#endif /* TOOLCHAIN_CLANG_VERSION < 200100 */
142142

143143
#endif /* CONFIG_MINIMAL_LIBC */
144144

0 commit comments

Comments
 (0)