public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Gallager <egall@gwmail.gwu.edu>
To: iain@sandoe.co.uk
Cc: gcc-patches@gcc.gnu.org, dmalcolm@redhat.com
Subject: Re: [PATCH] jit: Ensure ssize_t is defined.
Date: Sun, 28 Jan 2024 16:25:53 -0500	[thread overview]
Message-ID: <CAMfHzOsVtGh6BVqFicY8r5xssepikWU-jEaJ5gcwbJXPqD8D4A@mail.gmail.com> (raw)
In-Reply-To: <20240128114424.35213-1-iain@sandoe.co.uk>

On Sun, Jan 28, 2024 at 6:45 AM Iain Sandoe <iains.gcc@gmail.com> wrote:
>
> Tested on i686, x86_64 Darwin, x86_64 Linux,
> OK for trunk?
>
> --- 8< ---
>
> On some targets it seems that ssize_t is not defined by any of the
> headers transitively included by <stdio.h>.  This leads to a bootstrap
> fail when jit is enabled.
>
> The fix proposed here is to include sys/types.h when it is available
> since that is where Posix specifies that ssize_t is defined.
>
> gcc/jit/ChangeLog:
>
>         * libgccjit.h: Conditionally include <sys/types.h> where it is
>         available to ensure declaration of ssize_t.
>
> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
> ---
>  gcc/jit/libgccjit.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/gcc/jit/libgccjit.h b/gcc/jit/libgccjit.h
> index 235cab053e0..db4f27a48bf 100644
> --- a/gcc/jit/libgccjit.h
> +++ b/gcc/jit/libgccjit.h
> @@ -21,6 +21,9 @@ along with GCC; see the file COPYING3.  If not see
>  #define LIBGCCJIT_H
>
>  #include <stdio.h>
> +#if __has_include(<sys/types.h>)

Is __has_include() something that we can use unconditionally?

> +# include <sys/types.h>  /* For ssize_t.  */
> +#endif
>
>  #ifdef __cplusplus
>  extern "C" {
> --
> 2.39.2 (Apple Git-143)
>

  reply	other threads:[~2024-01-28 21:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-28 11:44 Iain Sandoe
2024-01-28 21:25 ` Eric Gallager [this message]
2024-01-28 23:13   ` Iain Sandoe
2024-01-29 11:26     ` Iain Sandoe
2024-04-02 11:45       ` Ping: " Iain Sandoe
2024-05-02 19:48 FX Coudert
2024-05-11 15:16 ` FX Coudert
2024-05-26 15:35   ` FX Coudert
2024-06-01 16:44   ` FX Coudert
2024-06-11  6:06   ` FX Coudert
2024-06-11  7:27     ` Richard Biener
2024-06-11  7:44       ` Jakub Jelinek
2024-06-11  8:03         ` Iain Sandoe
2024-06-11  8:04           ` Richard Biener
2024-06-11  8:06             ` Richard Biener
2024-06-11  8:16               ` Iain Sandoe
2024-06-11  8:34                 ` Andreas Schwab
2024-06-11  8:20               ` Jakub Jelinek
2024-06-11  8:21               ` Andreas Schwab
2024-06-11  8:21       ` FX Coudert
2024-06-11  7:20   ` Xi Ruoyao

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=CAMfHzOsVtGh6BVqFicY8r5xssepikWU-jEaJ5gcwbJXPqD8D4A@mail.gmail.com \
    --to=egall@gwmail.gwu.edu \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iain@sandoe.co.uk \
    /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).