[PATCH libevdev] Add unlikely() macro
Peter Hutterer
peter.hutterer at who-t.net
Tue Mar 4 19:21:43 PST 2014
Taken from systemd.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
This slots in before this 5-patch series.
libevdev/libevdev-util.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libevdev/libevdev-util.h b/libevdev/libevdev-util.h
index 227363c..ddcf5e3 100644
--- a/libevdev/libevdev-util.h
+++ b/libevdev/libevdev-util.h
@@ -28,6 +28,8 @@
#include <string.h>
#include "libevdev-int.h"
+#define unlikely(x) (__builtin_expect(!!(x),0))
+
static inline bool
startswith(const char *str, size_t len, const char *prefix, size_t plen)
{
--
1.8.4.2
More information about the Input-tools
mailing list