public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/aoliva/heads/testme)] [testsuite] tsvc: skip include malloc.h when unavailable
Date: Tue, 23 May 2023 04:00:59 +0000 (GMT)	[thread overview]
Message-ID: <20230523040059.CCF6E3858410@sourceware.org> (raw)

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>

                 reply	other threads:[~2023-05-23  4:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230523040059.CCF6E3858410@sourceware.org \
    --to=aoliva@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).