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

Also available in: Atom PDF