In stdc, if _STDIO_H_NOMACRO is not set (default), getchar will be
prototyped, and then immediately defined.
Later in posixc, if compiling with without NO_POSIX_WRAPPERS (that is,
_XOPEN_SOURCE or _POSIX_SOURCE or _BSD_SOURCE is defined, see
aros/features.h), getchar is prototyped again, except this time it is
already a macro, and the preprocessor gets confused (it thinks void is
an argument).
So, in stdc we force getchar to be either a prototype or a macro, and in
posixc we only prototype getchar if its not already a macro.
The twisty maze of feature macros has done my head in, and I can't be
sure what the impacts are, but I don't think it matters: ultimately, we
compile clean and getchar is provided to any program that wants it in an
ABI-safe way.
In stdc, if _STDIO_H_NOMACRO is not set (default), getchar will be prototyped, and then immediately defined.
Later in posixc, if compiling with without NO_POSIX_WRAPPERS (that is, _XOPEN_SOURCE or _POSIX_SOURCE or _BSD_SOURCE is defined, see aros/features.h), getchar is prototyped again, except this time it is already a macro, and the preprocessor gets confused (it thinks void is an argument).
So, in stdc we force getchar to be either a prototype or a macro, and in posixc we only prototype getchar if its not already a macro.
The twisty maze of feature macros has done my head in, and I can't be sure what the impacts are, but I don't think it matters: ultimately, we compile clean and getchar is provided to any program that wants it in an ABI-safe way.