We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 985d3b8 commit 54c29b0Copy full SHA for 54c29b0
2 files changed
libsrc/stdio/getchar.c
@@ -0,0 +1,8 @@
1
+#include "stdio.h"
2
+
3
+#include "./_file.h"
4
+#undef getchar
5
6
+int getchar(void) {
7
+ return fgetc(stdin);
8
+}
libsrc/stdio/putchar.c
@@ -1,11 +1,10 @@
#include "stdio.h"
-#if defined(__GNUC__)
#include "./_file.h"
// gcc replaces `printf("%c", c)` into `putchar(c)` implicitly.
#undef putchar
// Result: Success => c, Failure => EOF
int putchar(int c) {
9
return _fputc(c, stdout);
10
}
11
-#endif
0 commit comments