public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] jit: Ensure ssize_t is defined.
@ 2024-01-28 11:44 Iain Sandoe
  2024-01-28 21:25 ` Eric Gallager
  0 siblings, 1 reply; 5+ messages in thread
From: Iain Sandoe @ 2024-01-28 11:44 UTC (permalink / raw)
  To: gcc-patches; +Cc: dmalcolm

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-02 11:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-28 11:44 [PATCH] jit: Ensure ssize_t is defined Iain Sandoe
2024-01-28 21:25 ` Eric Gallager
2024-01-28 23:13   ` Iain Sandoe
2024-01-29 11:26     ` Iain Sandoe
2024-04-02 11:45       ` Ping: " Iain Sandoe

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).