Bug #867
closed
1.4.3: src/util-optimize.h: Solaris Sun Studio doesn't define __builtin_expect
Added by Mark Solaris over 11 years ago.
Updated about 7 years ago.
Description
The __builtin_expect definition ships in GCC but not any other compiler.
We use the fix from here:
https://forums.oracle.com/thread/1995055
--- suricata-1.4.3/src/util-optimize.h.orig Tue Jul 9 13:31:34 2013
+++ suricata-1.4.3/src/util-optimize.h Tue Jul 9 13:31:44 2013
@@ -24,6 +24,10 @@
* \author Victor Julien <victor@inliniac.net>
*/
+#if !defined(__builtin_expect)
+# define __builtin_expect(e, n) ((e)==(n))
+#endif
+
#ifndef likely
#define likely(expr) __builtin_expect(!!(expr), 1)
#endif
Shoot, I changed it from the right one to the wrong one and now this is the right one again :) redmine needs an edit function. +1 one for switching to Jira :)
--- suricata-1.4.3/src/util-optimize.h.orig Tue Jul 9 13:31:34 2013
+++ suricata-1.4.3/src/util-optimize.h Tue Jul 9 13:31:44 2013
@@ -24,6 +24,10 @@
* \author Victor Julien <victor@inliniac.net>
*/
+#if !defined(__builtin_expect)
+# define __builtin_expect(e,n) (e)
+#endif
+
#ifndef likely
#define likely(expr) __builtin_expect(!!(expr), 1)
#endif
- Target version set to TBD
This is still in the master dated 2013-12-02
The proper procedure for getting code in is through git(hub) as described here Contributing_to_Suricata. We won't be scraping the tickets for patches.
- Status changed from New to Closed
- Target version deleted (
TBD)
Also available in: Atom
PDF