Added weak attribute definition
authorDavide Libenzi <dlibenzi@google.com>
Tue, 15 Dec 2015 13:37:41 +0000 (05:37 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 17 Dec 2015 20:42:28 +0000 (15:42 -0500)
Added weak attribute definition.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/compiler.h

index 5f0433f..d43c1c3 100644 (file)
@@ -4,10 +4,12 @@
 
 #define likely(x) __builtin_expect(!!(x), 1)
 #define unlikely(x) __builtin_expect(!!(x), 0)
+#define __weak __attribute__((weak))
 
 #else /* #ifdef __GNUC__ */
 
 #define likely(x) (x)
 #define unlikely(x) (x)
+#define __weak
 
 #endif /* #ifdef __GNUC__ */