From 2cdb55a93f5dbf032fab0102758c40b08dc9dab8 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sat, 15 Aug 2015 11:53:01 +0200 Subject: Avoid re-defining macros * kern/macros.h: Avoid re-defining macros. * linux/src/include/linux/compiler-gcc.h: Likewise. * linux/src/include/linux/compiler.h: Likewise. --- kern/macros.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'kern') diff --git a/kern/macros.h b/kern/macros.h index fb8dc5e..7cc579d 100644 --- a/kern/macros.h +++ b/kern/macros.h @@ -54,15 +54,23 @@ #define alignof(x) __alignof__(x) +#ifndef likely #define likely(expr) __builtin_expect(!!(expr), 1) +#endif /* likely */ +#ifndef unlikely #define unlikely(expr) __builtin_expect(!!(expr), 0) +#endif /* unlikely */ +#ifndef barrier #define barrier() asm volatile("" : : : "memory") +#endif /* barrier */ #define __noreturn __attribute__((noreturn)) #define __aligned(x) __attribute__((aligned(x))) #define __always_inline inline __attribute__((always_inline)) +#ifndef __section #define __section(x) __attribute__((section(x))) +#endif /* __section */ #define __packed __attribute__((packed)) #define __alias(x) __attribute__((alias(x))) -- cgit v1.2.3