From d31db877e282b540b68e4a9633bfa3dd2e563545 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 14 Apr 2025 10:50:41 -0400 Subject: [PATCH] util/simple_mtx: fix duplicate definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit botched #ifdef in the cited commit caused simple_mtx_t to be defined twice in certain cases, which broke the docs build. Fixes: cb31b5a9588 ("clc,libcl: Clean up CL includes") Reported-by: Erik Faye-Lund Reviewed-by: Erik Faye-Lund Reviewed-by: Marek Olšák Tested-by: Vinson Lee Signed-off-by: Alyssa Rosenzweig Part-of: --- src/util/simple_mtx.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/util/simple_mtx.h b/src/util/simple_mtx.h index ab206cebcd8..4152bb681e0 100644 --- a/src/util/simple_mtx.h +++ b/src/util/simple_mtx.h @@ -50,10 +50,6 @@ * condition variables. */ -typedef struct { - uint32_t val; -} simple_mtx_t; - #ifndef __OPENCL_VERSION__ #include "util/futex.h" @@ -78,6 +74,9 @@ extern "C" { #endif #if UTIL_FUTEX_SUPPORTED +typedef struct { + uint32_t val; +} simple_mtx_t; #define SIMPLE_MTX_INITIALIZER { 0 } @@ -209,6 +208,11 @@ simple_mtx_assert_locked(simple_mtx_t *mtx) #else +/* Dummy implementation to let more headers compile with OpenCL */ +typedef struct { + uint32_t _; +} simple_mtx_t; + #endif #endif /* _SIMPLE_MTX_H */