[libc-commits] [libc] 60d4a10 - [libc] Guard common macro names
Alex Brachet via libc-commits
libc-commits at lists.llvm.org
Tue Jun 14 08:05:48 PDT 2022
Author: Alex Brachet
Date: 2022-06-14T15:05:16Z
New Revision: 60d4a10710693d9562fa2c01307d2acddbe104bb
URL: https://github.com/llvm/llvm-project/commit/60d4a10710693d9562fa2c01307d2acddbe104bb
DIFF: https://github.com/llvm/llvm-project/commit/60d4a10710693d9562fa2c01307d2acddbe104bb.diff
LOG: [libc] Guard common macro names
Differential revision: https://reviews.llvm.org/D127692
Added:
Modified:
libc/src/__support/common.h
Removed:
################################################################################
diff --git a/libc/src/__support/common.h b/libc/src/__support/common.h
index 2660e7f682c5b..9e28be0ea5f75 100644
--- a/libc/src/__support/common.h
+++ b/libc/src/__support/common.h
@@ -11,9 +11,15 @@
#define LIBC_INLINE_ASM __asm__ __volatile__
+#ifndef likely
#define likely(x) __builtin_expect(!!(x), 1)
+#endif
+#ifndef unlikely
#define unlikely(x) __builtin_expect(x, 0)
+#endif
+#ifndef UNUSED
#define UNUSED __attribute__((unused))
+#endif
#ifndef LLVM_LIBC_FUNCTION_ATTR
#define LLVM_LIBC_FUNCTION_ATTR
More information about the libc-commits
mailing list