From dd0a5fe086255e9b8353a084842833f9e39e956c Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 23 Dec 2012 19:00:26 +0100 Subject: digital/ucoolib/ucoolib: add __builtin_expect to assert --- digital/ucoolib/ucoolib/common.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'digital/ucoolib') diff --git a/digital/ucoolib/ucoolib/common.hh b/digital/ucoolib/ucoolib/common.hh index 83763899..4bedaa64 100644 --- a/digital/ucoolib/ucoolib/common.hh +++ b/digital/ucoolib/ucoolib/common.hh @@ -59,7 +59,7 @@ halt_perror () __attribute__ ((noreturn)); extern inline void assert (bool condition) { - if (!condition) + if (!__builtin_expect (condition, 1)) halt (); } @@ -77,7 +77,7 @@ assert_unreachable () extern inline void assert_perror (bool condition) { - if (!condition) + if (!__builtin_expect (condition, 1)) halt_perror (); } -- cgit v1.2.3