]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/blobdiff - src/coloredstderr.c
Also hook un-macroed putc when it's a macro.
[coloredstderr/coloredstderr.git] / src / coloredstderr.c
index a78fdd9a2e7ed377b36e56555d2de77f9fe1960a..66467b402e14d0a95b630dea38e1e3d59a77a7d7 100644 (file)
@@ -238,6 +238,14 @@ HOOK_FILE2(int, fputc, stream,
            int, c, FILE *, stream)
 HOOK_FILE2(int, putc, stream,
            int, c, FILE *, stream)
+/* The glibc uses a macro for putc() which expands to _IO_putc(). However
+ * sometimes the raw putc() is used as well, not sure why. Make sure to hook
+ * it too. */
+#ifdef putc
+# undef putc
+HOOK_FILE2(int, putc, stream,
+           int, c, FILE *, stream)
+#endif
 HOOK_FILE1(int, putchar, stdout,
            int, c)
 HOOK_FILE1(int, puts, stdout,