summaryrefslogtreecommitdiffstats
path: root/runtime/rsyslog.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-10-26 16:03:27 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-10-26 16:03:27 +0200
commitdc4db17f51cc6d88af10a6155292ea53180a8e66 (patch)
treeae1a007713ed2bace76e4560bf20adbb84be4c73 /runtime/rsyslog.h
parentefa8dfb47da3ea46f06ab561aeb82ef1d6c3ee93 (diff)
parent620d0448171378748495f495b6db7b67686cdf49 (diff)
downloadrsyslog-dc4db17f51cc6d88af10a6155292ea53180a8e66.tar.gz
rsyslog-dc4db17f51cc6d88af10a6155292ea53180a8e66.tar.bz2
rsyslog-dc4db17f51cc6d88af10a6155292ea53180a8e66.zip
Merge branch 'master-var-refactor' into master-ruleeng
Diffstat (limited to 'runtime/rsyslog.h')
-rw-r--r--runtime/rsyslog.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index 5f0401df..edf0c593 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -399,7 +399,12 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
* Be sure to call the to-be-returned variable always "iRet" and
* the function finalizer always "finalize_it".
*/
-#define CHKiRet(code) if((iRet = code) != RS_RET_OK) goto finalize_it
+#if HAVE_BUILTIN_EXCEPT
+# define CHKiRet(code) if(__builtin_expect(((iRet = code) != RS_RET_OK), 0)) goto finalize_it
+#else
+# define CHKiRet(code) if((iRet = code) != RS_RET_OK) goto finalize_it
+#endif
+
/* macro below is to be used if we need our own handling, eg for cleanup */
#define CHKiRet_Hdlr(code) if((iRet = code) != RS_RET_OK)
/* macro below is to handle failing malloc/calloc/strdup... which we almost always handle in the same way... */