Actions
Bug #867
closed1.4.3: src/util-optimize.h: Solaris Sun Studio doesn't define __builtin_expect
Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Affected Versions:
Effort:
Difficulty:
Label:
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
Updated by Mark Solaris over 11 years ago
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
Updated by Mark Solaris almost 11 years ago
This is still in the master dated 2013-12-02
Updated by Victor Julien almost 11 years ago
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.
Actions