From 21da5ebbedae6e62ec9bbf8a9027ca0c4a1b26f1 Mon Sep 17 00:00:00 2001 From: "Bernhard R. Link" Date: Wed, 15 Jul 2009 17:45:07 +0200 Subject: use gcc's __builtin_prefetch if available to silence problems with the empty prefetch function --- src/linkedlist.c | 2 ++ src/linkedlist.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/linkedlist.c b/src/linkedlist.c index f79757b..ae3d143 100644 --- a/src/linkedlist.c +++ b/src/linkedlist.c @@ -24,9 +24,11 @@ #include "linkedlist.h" +#if __GNUC__ <= 3 void prefetch(const void *x) {;} +#endif /* * Insert a new entry between two known consecutive entries. diff --git a/src/linkedlist.h b/src/linkedlist.h index 7f147b1..4434766 100644 --- a/src/linkedlist.h +++ b/src/linkedlist.h @@ -76,7 +76,11 @@ void list_add(struct list_head *new, struct list_head *head); void __list_add(struct list_head *new, struct list_head *prev, struct list_head *next); +#if __GNUC__ > 3 +#define prefetch __builtin_prefetch +#else void prefetch(const void *x); +#endif /* Return the last element in the list. */ #define list_last(last, head, member) \ -- cgit v1.2.3