Project

General

Profile

Actions

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.

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
Actions #1

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
Actions #2

Updated by Victor Julien about 11 years ago

  • Target version set to TBD
Actions #3

Updated by Mark Solaris almost 11 years ago

This is still in the master dated 2013-12-02

Actions #4

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 #5

Updated by Andreas Herz almost 9 years ago

  • Status changed from New to Closed
Actions #6

Updated by Victor Julien about 7 years ago

  • Target version deleted (TBD)
Actions

Also available in: Atom PDF