Subject: | 0.08 breaks on older (2.x) gcc compilers |
/usr/libexec/ld-elf.so.1: /usr/local/lib/perl5/site_perl/5.8.9/i386-freebsd/auto/HTTP/Parser/XS/XS.so: Undefined symbol "__builtin_expect"
Changing the check in picohttpparser/picohttpparser.c to be explicit about GCC version fixes it:
--- picohttpparser/picohttpparser.c.orig Tue Nov 16 21:28:14 2010
+++ picohttpparser/picohttpparser.c Tue Nov 16 21:28:41 2010
@@ -1,7 +1,7 @@
#include <stddef.h>
#include "picohttpparser.h"
-#ifdef __GNUC__
+#if __GNUC__ >= 3
# define likely(x) __builtin_expect(!!(x), 1)
# define unlikely(x) __builtin_expect(!!(x), 0)
#else
Changing the check in picohttpparser/picohttpparser.c to be explicit about GCC version fixes it:
--- picohttpparser/picohttpparser.c.orig Tue Nov 16 21:28:14 2010
+++ picohttpparser/picohttpparser.c Tue Nov 16 21:28:41 2010
@@ -1,7 +1,7 @@
#include <stddef.h>
#include "picohttpparser.h"
-#ifdef __GNUC__
+#if __GNUC__ >= 3
# define likely(x) __builtin_expect(!!(x), 1)
# define unlikely(x) __builtin_expect(!!(x), 0)
#else