I’d like to ping the patch at https://gcc.gnu.org/pipermail/gcc-patches/2024-January/644134.html The original proposal by Iain was:
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" { but it seems we can’t use __has_include. However, other code in GCC treats <sys/types.h> as available on all targets. See unconditional inclusion in gcc/system.h and gcc/tsystem.h. The latter even says: /* All systems have this header. */ #include <sys/types.h> So: would an unconditional inclusion be suitable? I’ve tested on linux and darwin with no issues: diff --git a/gcc/jit/libgccjit.h b/gcc/jit/libgccjit.h index 74e847b2dec..cbe0f70abee 100644 --- a/gcc/jit/libgccjit.h +++ b/gcc/jit/libgccjit.h @@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see #define LIBGCCJIT_H #include <stdio.h> +#include <sys/types.h> #ifdef __cplusplus extern "C” { Thanks, FX