]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[testsuite] tsvc: skip include malloc.h when unavailable
authorAlexandre Oliva <oliva@adacore.com>
Wed, 24 May 2023 06:07:46 +0000 (03:07 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 25 May 2023 02:40:31 +0000 (23:40 -0300)
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

index 75494c24cfa6237cf477d673d24e1b41691225a2..cd39c041903ddab21cfbbdf415919502592fa04d 100644 (file)
 
 #include <stdio.h>
 #include <stdlib.h>
-#if !defined(__APPLE__) && !defined(__DragonFly__)
+#if __has_include(<malloc.h>)
 #include <malloc.h>
 #endif
+#if __has_include(<sys/time.h>)
+#include <sys/time.h>
+#endif
 #include <string.h>
 #include <math.h>