diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 3b0aea9..ee0bb69 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -76,6 +76,11 @@ #include #include #endif + +#if defined (linux) +#define _GNU_SOURCE 1 +#include +#endif #ifdef __PikeOS__ #define __BSD_VISIBLE 1 @@ -3255,7 +3260,6 @@ __gnat_lwp_self (void) #endif #if defined (__linux__) -#include /* glibc versions earlier than 2.7 do not define the routines to handle dynamically allocated CPU sets. For these targets, we use the static @@ -3265,7 +3269,7 @@ __gnat_lwp_self (void) /* Dynamic cpu sets */ -cpu_set_t * +void * __gnat_cpu_alloc (size_t count) { return CPU_ALLOC (count); @@ -3278,33 +3282,33 @@ __gnat_cpu_alloc_size (size_t count) } void -__gnat_cpu_free (cpu_set_t *set) +__gnat_cpu_free (void *set) { - CPU_FREE (set); + CPU_FREE ((cpu_set_t *) set); } void -__gnat_cpu_zero (size_t count, cpu_set_t *set) +__gnat_cpu_zero (size_t count, void *set) { - CPU_ZERO_S (count, set); + CPU_ZERO_S (count, (cpu_set_t *) set); } void -__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set) +__gnat_cpu_set (int cpu, size_t count, void *set) { /* Ada handles CPU numbers starting from 1, while C identifies the first CPU by a 0, so we need to adjust. */ - CPU_SET_S (cpu - 1, count, set); + CPU_SET_S (cpu - 1, count, (cpu_set_t *) set); } #else /* !CPU_ALLOC */ /* Static cpu sets */ -cpu_set_t * +void * __gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED) { - return (cpu_set_t *) xmalloc (sizeof (cpu_set_t)); + return xmalloc (sizeof (cpu_set_t)); } size_t @@ -3314,23 +3318,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED) } void -__gnat_cpu_free (cpu_set_t *set) +__gnat_cpu_free (void *set) { free (set); } void -__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) +__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set) { - CPU_ZERO (set); + CPU_ZERO ((cpu_set_t *) set); } void -__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) +__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set) { /* Ada handles CPU numbers starting from 1, while C identifies the first CPU by a 0, so we need to adjust. */ - CPU_SET (cpu - 1, set); + CPU_SET (cpu - 1, (cpu_set_t *) set); } #endif /* !CPU_ALLOC */ #endif /* __linux__ */ diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h index 0d12f7e..a063b47 100644 --- a/gcc/ada/adaint.h +++ b/gcc/ada/adaint.h @@ -316,13 +316,11 @@ extern void *__gnat_lwp_self (void); /* Routines for interface to required CPU set primitives */ -#include - -extern cpu_set_t *__gnat_cpu_alloc (size_t); +extern void * __gnat_cpu_alloc (size_t); extern size_t __gnat_cpu_alloc_size (size_t); -extern void __gnat_cpu_free (cpu_set_t *); -extern void __gnat_cpu_zero (size_t, cpu_set_t *); -extern void __gnat_cpu_set (int, size_t, cpu_set_t *); +extern void __gnat_cpu_free (void *); +extern void __gnat_cpu_zero (size_t, void *); +extern void __gnat_cpu_set (int, size_t, void *); #endif #if defined (_WIN32) diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c index 7025f57..207b50d 100644 --- a/gcc/ada/terminals.c +++ b/gcc/ada/terminals.c @@ -1108,13 +1108,6 @@ __gnat_setup_winsize (void *desc, int rows, int columns) #include #include -/* On some system termio is either absent or including it will disable termios - (HP-UX) */ -#if !defined (__hpux__) && !defined (BSD) && !defined (__APPLE__) \ - && !defined (__rtems__) && !defined (__QNXNTO__) -# include -#endif - #include #include #include diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index ebb955e..08cfbee 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -1028,7 +1028,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) s-tpopsp.adb