diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt --- a/libc/src/__support/CMakeLists.txt +++ b/libc/src/__support/CMakeLists.txt @@ -1,9 +1,5 @@ -add_gen_header( +add_header_library( common - DEF_FILE common.h.def - PARAMS - platform_defs=../../config/${LIBC_TARGET_OS}/platform_defs.h.inc - GEN_HDR common.h - DATA_FILES - ../../config/${LIBC_TARGET_OS}/platform_defs.h.inc + HDRS + common.h ) diff --git a/libc/src/__support/common.h.def b/libc/src/__support/common.h rename from libc/src/__support/common.h.def rename to libc/src/__support/common.h --- a/libc/src/__support/common.h.def +++ b/libc/src/__support/common.h @@ -11,22 +11,22 @@ #define LIBC_INLINE_ASM __asm__ __volatile__ -#define likely(x) __builtin_expect (!!(x), 1) -#define unlikely(x) __builtin_expect (x, 0) +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(x, 0) #define UNUSED __attribute__((unused)) #ifndef LLVM_LIBC_FUNCTION_ATTR - #define LLVM_LIBC_FUNCTION_ATTR +#define LLVM_LIBC_FUNCTION_ATTR #endif #ifdef LLVM_LIBC_PUBLIC_PACKAGING -#define LLVM_LIBC_FUNCTION(type, name, arglist) \ - LLVM_LIBC_FUNCTION_ATTR decltype(__llvm_libc::name) __##name##_impl__ __asm__(#name); \ - decltype(__llvm_libc::name) name [[gnu::alias(#name)]]; \ - type __##name##_impl__ arglist +#define LLVM_LIBC_FUNCTION(type, name, arglist) \ + LLVM_LIBC_FUNCTION_ATTR decltype(__llvm_libc::name) \ + __##name##_impl__ __asm__(#name); \ + decltype(__llvm_libc::name) name [[gnu::alias(#name)]]; \ + type __##name##_impl__ arglist #else -#define LLVM_LIBC_FUNCTION(type, name, arglist)\ - type name arglist +#define LLVM_LIBC_FUNCTION(type, name, arglist) type name arglist #endif #endif // LLVM_LIBC_SUPPORT_COMMON_H