diff --git a/clang/lib/Headers/stddef.h b/clang/lib/Headers/stddef.h --- a/clang/lib/Headers/stddef.h +++ b/clang/lib/Headers/stddef.h @@ -98,7 +98,8 @@ #endif /* defined(__need_NULL) */ #if defined(__need_STDDEF_H_misc) -#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ + (defined(__cplusplus) && __cplusplus >= 201103L) #include "__stddef_max_align_t.h" #endif #define offsetof(t, d) __builtin_offsetof(t, d) diff --git a/clang/lib/Headers/stdint.h b/clang/lib/Headers/stdint.h --- a/clang/lib/Headers/stdint.h +++ b/clang/lib/Headers/stdint.h @@ -91,6 +91,9 @@ * defined if there exists an exact-width type of equal or greater width. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmacro-redefined" + #ifdef __INT64_TYPE__ # ifndef __int8_t_defined /* glibc sys/types.h also defines int64_t*/ typedef __INT64_TYPE__ int64_t; @@ -857,5 +860,7 @@ #define WINT_WIDTH __WINT_WIDTH__ #endif +#pragma GCC diagnostic pop + #endif /* __STDC_HOSTED__ */ #endif /* __CLANG_STDINT_H */