summaryrefslogtreecommitdiffhomepage
path: root/digital/ucoolib/ucoolib/common.hh
diff options
context:
space:
mode:
authorNicolas Schodet2012-12-23 19:00:26 +0100
committerNicolas Schodet2012-12-23 23:04:00 +0100
commitdd0a5fe086255e9b8353a084842833f9e39e956c (patch)
tree91047eef4643d458c8e247b784b91c2c3ce78681 /digital/ucoolib/ucoolib/common.hh
parent3e923e67e215a9de7a2078ed4d590828d0790f3b (diff)
digital/ucoolib/ucoolib: add __builtin_expect to assert
Diffstat (limited to 'digital/ucoolib/ucoolib/common.hh')
-rw-r--r--digital/ucoolib/ucoolib/common.hh4
1 files changed, 2 insertions, 2 deletions
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 ();
}