import_c<stdio.h>
You can import C headers without your language being a superset of C.
You can import C headers without your language being a superset of C.
Are you sure about this?
#define getc(stream) ...
of course, but that's the only legal definition anyway).("Free-standing implementations" like kernels have a lot of freedom to muck with the standard library. But that's not really relevant.)
#define getc fgetc_or_similar
At least C89/90 only mentions that if it is a macro, it may evaluate arguments more than once (but then it may not, as in the above case). #include <stdio.h>
#undef getc
int main(void) {
getc(stdin);
return 0;
}
so it cannot be implemented as only a macro.