diff --git a/include/zephyr/toolchain/llvm.h b/include/zephyr/toolchain/llvm.h index 8a78d4e8404..a77e82a45e2 100644 --- a/include/zephyr/toolchain/llvm.h +++ b/include/zephyr/toolchain/llvm.h @@ -34,80 +34,42 @@ #define __INT8_C(x) x #endif -#ifndef INT8_C -#define INT8_C(x) __INT8_C(x) -#endif - #ifndef __UINT8_C #define __UINT8_C(x) x ## U #endif -#ifndef UINT8_C -#define UINT8_C(x) __UINT8_C(x) -#endif - #ifndef __INT16_C #define __INT16_C(x) x #endif -#ifndef INT16_C -#define INT16_C(x) __INT16_C(x) -#endif - #ifndef __UINT16_C #define __UINT16_C(x) x ## U #endif -#ifndef UINT16_C -#define UINT16_C(x) __UINT16_C(x) -#endif - #ifndef __INT32_C #define __INT32_C(x) x #endif -#ifndef INT32_C -#define INT32_C(x) __INT32_C(x) -#endif - #ifndef __UINT32_C #define __UINT32_C(x) x ## U #endif -#ifndef UINT32_C -#define UINT32_C(x) __UINT32_C(x) -#endif - #ifndef __INT64_C #define __INT64_C(x) x #endif -#ifndef INT64_C -#define INT64_C(x) __INT64_C(x) -#endif - #ifndef __UINT64_C #define __UINT64_C(x) x ## ULL #endif -#ifndef UINT64_C -#define UINT64_C(x) __UINT64_C(x) -#endif - #ifndef __INTMAX_C #define __INTMAX_C(x) x #endif -#ifndef INTMAX_C -#define INTMAX_C(x) __INTMAX_C(x) -#endif #ifndef __UINTMAX_C #define __UINTMAX_C(x) x ## ULL #endif -#ifndef UINTMAX_C -#define UINTMAX_C(x) __UINTMAX_C(x) -#endif #endif /* ZEPHYR_INCLUDE_TOOLCHAIN_LLVM_H_ */ diff --git a/lib/libc/minimal/include/stdint.h b/lib/libc/minimal/include/stdint.h index 904f0b49b25..80a2ff1ab29 100644 --- a/lib/libc/minimal/include/stdint.h +++ b/lib/libc/minimal/include/stdint.h @@ -104,7 +104,7 @@ typedef __UINT_LEAST64_TYPE__ uint_least64_t; typedef __INTPTR_TYPE__ intptr_t; typedef __UINTPTR_TYPE__ uintptr_t; -#ifdef __GNUC__ +#if defined(__GNUC__) || defined(__clang__) /* These macros must produce constant integer expressions, which can't * be done in the preprocessor (casts aren't allowed). Defer to the * GCC internal functions where they're available. @@ -120,7 +120,7 @@ typedef __UINTPTR_TYPE__ uintptr_t; #define UINT32_C(_v) __UINT32_C(_v) #define UINT64_C(_v) __UINT64_C(_v) #define UINTMAX_C(_v) __UINTMAX_C(_v) -#endif /* __GNUC__ */ +#endif /* defined(__GNUC__) || defined(__clang__) */ #ifdef __CCAC__ #ifndef __INT8_C