--- gcc-6.3.0-A/gcc/ada/adaint.c +++ gcc-6.3.0-B/gcc/ada/adaint.c @@ -3086,7 +3086,7 @@ #endif #if defined (__linux__) -#include +/* do not #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 --- gcc-6.3.0-A/gcc/ada/adaint.h +++ gcc-6.3.0-B/gcc/ada/adaint.h @@ -287,7 +287,17 @@ /* Routines for interface to required CPU set primitives */ -#include +/* Do not #include , but copy part of it and prevent its inclusion */ +# ifndef _SCHED_H +# define _SCHED_H +typedef struct cpu_set_t { unsigned long __bits[128/sizeof(long)]; } cpu_set_t; +# define CPU_ZERO_S(size,set) memset(set,0,size) +# define CPU_ZERO(set) CPU_ZERO_S(sizeof(cpu_set_t),set) +# define __CPU_op_S(i, size, set, op) ( (i)/8U >= (size) ? 0 : \ + (((unsigned long *)(set))[(i)/8/sizeof(long)] op (1UL<<((i)%(8*sizeof(long))))) ) +# define CPU_SET_S(i, size, set) __CPU_op_S(i, size, set, |=) +# define CPU_SET(i, set) CPU_SET_S(i,sizeof(cpu_set_t),set) +# endif extern cpu_set_t *__gnat_cpu_alloc (size_t); extern size_t __gnat_cpu_alloc_size (size_t);