From: Kefu Chai Date: Sun, 22 Jul 2018 03:01:10 +0000 (+0800) Subject: common: guard likly macros with #ifdef X-Git-Tag: v14.0.1~764^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dbf337582f1e74aa07258f8e73f71ca28696fbb2;p=ceph.git common: guard likly macros with #ifdef DPDK also defines them. Signed-off-by: Kefu Chai --- diff --git a/src/common/likely.h b/src/common/likely.h index c095dd39d3b..abaf2d2e2d5 100644 --- a/src/common/likely.h +++ b/src/common/likely.h @@ -18,9 +18,14 @@ /* * Likely / Unlikely macros */ +#ifndef likely #define likely(x) __builtin_expect((x),1) +#endif +#ifndef unlikely #define unlikely(x) __builtin_expect((x),0) - +#endif +#ifndef expect #define expect(x, hint) __builtin_expect((x),(hint)) +#endif #endif