aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2023-05-24 03:07:46 -0300
committerAlexandre Oliva <oliva@gnu.org>2023-05-24 23:40:31 -0300
commit2f20d6296087cae51f55eeecb3efefe786191fd6 (patch)
tree80b547f9d2f33dd3bb45081b7088b6ef4d45e521
parent7daa166fe89fca4ff1baa063c00a5a690f7e462f (diff)
downloadgcc-2f20d6296087cae51f55eeecb3efefe786191fd6.zip
gcc-2f20d6296087cae51f55eeecb3efefe786191fd6.tar.gz
gcc-2f20d6296087cae51f55eeecb3efefe786191fd6.tar.bz2
[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.
-rw-r--r--gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h
index 75494c2..cd39c04 100644
--- a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h
+++ b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h
@@ -11,9 +11,12 @@
#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>