From b300db55f6452ae947e39c08d57db23934cf02f0 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 5 Nov 2024 15:41:57 +0100 Subject: [PATCH] BUILD: compiler: define __builtin_prefetch() for tcc We're using a few occurrences of __builtin_prefetch() but tcc doesn't know about it so let's give it a dummy definition. Now the code builds and works again with tcc without thread support. --- include/haproxy/compiler.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/haproxy/compiler.h b/include/haproxy/compiler.h index d8e8a7235b..ba4b12ddca 100644 --- a/include/haproxy/compiler.h +++ b/include/haproxy/compiler.h @@ -264,6 +264,11 @@ #endif #endif +/* Define the missing __builtin_prefetch() for tcc. */ +#if defined(__TINYC__) +#define __builtin_prefetch(addr, ...) do { } while (0) +#endif + #ifndef __GNUC_PREREQ__ #if defined(__GNUC__) && !defined(__INTEL_COMPILER) #define __GNUC_PREREQ__(ma, mi) \ -- 2.47.2