X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_common.h;h=82dad3670f8926ff09dc817c24ee164467678c02;hb=827b111356e910800788245bb1a2a22017fea857;hp=e4b1cc5d4eb68f17b56a1d6677e6992d420362a9;hpb=87e6f1be1272e4a1e74fb23f5a97e71ad4c67006;p=vlc diff --git a/include/vlc_common.h b/include/vlc_common.h index e4b1cc5d4e..82dad3670f 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -69,6 +69,15 @@ # define LIBVLC_MALLOC #endif +/* Branch prediction */ +#ifdef __GNUC__ +# define likely(p) __builtin_expect(!!(p), 1) +# define unlikely(p) __builtin_expect(!!(p), 0) +#else +# define likely(p) (!!(p)) +# define unlikely(p) (!!(p)) +#endif + /***************************************************************************** * Basic types definitions *****************************************************************************/