diff --git a/sources/fgetc.c b/sources/fgetc.c index 8a8e36e..d0abc1e 100644 --- a/sources/fgetc.c +++ b/sources/fgetc.c @@ -36,4 +36,6 @@ int fgetc(FILE *stream) } return ch; } +#ifdef __GNUC__ int getc(FILE *stream) __attribute__((alias("fgetc"))); +#endif diff --git a/sources/getc.c b/sources/getc.c index 39d51f1..2ba5762 100644 --- a/sources/getc.c +++ b/sources/getc.c @@ -1,6 +1,9 @@ #include +#ifndef __GNUC__ +/* with GCC, getc() is an alias of fgetc() defined in fgetc.c */ int getc(FILE *stream) { return fgetc(stream); -} \ No newline at end of file +} +#endif