From 48869f1c0b6e4c318b680f6f672a9f90dfe31bff Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 8 Jul 2025 21:39:04 +0100 Subject: [PATCH] common/include/test-once.c: Skip test on macOS which lacks pthread_barrier_t See: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap02.html (cherry picked from commit 8271f9244f1521c716460820d8162e7641018674) --- common/include/test-once.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/common/include/test-once.c b/common/include/test-once.c index d7dd5c42..512b1a20 100644 --- a/common/include/test-once.c +++ b/common/include/test-once.c @@ -34,29 +34,29 @@ #include #include +#include +#include -#ifndef HAVE_STDATOMIC_H +#if !defined(HAVE_STDATOMIC_H) || !defined(_POSIX_BARRIERS) -/* Skip the test if no */ +/* Skip the test if no or pthread_barrier_t */ int main (void) { - printf ("SKIP: no on this platform\n"); + fprintf (stderr, + "SKIP: no or pthread_barrier_t on this platform\n"); exit (77); } -#else /* HAVE_STDATOMIC_H */ +#else #include #include -#include #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ #include -#include - #include "once.h" #define NR_THREADS 8 @@ -123,4 +123,4 @@ main (void) exit (EXIT_SUCCESS); } -#endif /* HAVE_STDATOMIC_H */ +#endif -- 2.47.1