From 2f20d6296087cae51f55eeecb3efefe786191fd6 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Wed, 24 May 2023 03:07:46 -0300 Subject: [PATCH] [testsuite] tsvc: skip include malloc.h when unavailable tsvc tests all fail on systems that don't offer a malloc.h, other than those that explicitly rule that out. Use the preprocessor to test for malloc.h's availability. tsvc.h also expects a definition for struct timeval, but it doesn't include sys/time.h. Add a conditional include thereof. for gcc/testsuite/ChangeLog * gcc.dg/vect/tsvc/tsvc.h: Test for and conditionally include malloc.h and sys/time.h. --- gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h index 75494c24cfa6..cd39c041903d 100644 --- a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h +++ b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h @@ -11,9 +11,12 @@ #include #include -#if !defined(__APPLE__) && !defined(__DragonFly__) +#if __has_include() #include #endif +#if __has_include() +#include +#endif #include #include -- 2.47.2