cygwin (newlib) stdlib.h has: void abort (void) _ATTRIBUTE ((__noreturn__));
Defining abort() before this causes a preprocessor error because it's not expecting arguments. This is probably similar on most platforms, but care is taken not to include the <stdlib.h> first. On cygwin there are various places that include <windows.h>, and it ends up indirectly including <stdlib.h>. --- gcc/tsystem.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/tsystem.h b/gcc/tsystem.h index efc59b14d46..0e0e669d95e 100644 --- a/gcc/tsystem.h +++ b/gcc/tsystem.h @@ -66,6 +66,12 @@ extern void free (void *); extern int atexit (void (*)(void)); #endif +// cygwin has a definition of abort that will conflict with the macro below +// when included via windows.h +#ifdef __CYGWIN__ +#include <stdlib.h> +#endif + #ifndef abort #define abort() __builtin_trap () #endif -- 2.50.1
