public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] [testsuite] tsvc: skip include malloc.h when unavailable
@ 2023-05-23 4:00 Alexandre Oliva
0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2023-05-23 4:00 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:020140ae3bfb626e8229c5f282a971991e14ca20
commit 020140ae3bfb626e8229c5f282a971991e14ca20
Author: Alexandre Oliva <oliva@adacore.com>
Date: Mon May 22 23:07:13 2023 -0300
[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.
TN: W519-013
Diff:
---
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 75494c24cfa..cd39c041903 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>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-23 4:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-23 4:00 [gcc(refs/users/aoliva/heads/testme)] [testsuite] tsvc: skip include malloc.h when unavailable Alexandre Oliva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).