]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/blobdiff - src/hookmacros.h
Fix hook for putc_unlocked() with glibc.
[coloredstderr/coloredstderr.git] / src / hookmacros.h
index b5e2cb0b1fdb93d7ab95cb58012b6d5177ec3a00..b8b70ec03bf035fc26c927de13e5caaaa7331daa 100644 (file)
         _HOOK_POST_FD_(fd) \
     }
 
+#define HOOK_FD2(type, name, fd, type1, arg1, type2, arg2) \
+    static type (*real_ ## name)(type1, type2); \
+    type name(type1 arg1, type2 arg2) { \
+        _HOOK_PRE_FD(type, name, fd) \
+        result = real_ ## name(arg1, arg2); \
+        _HOOK_POST_FD(fd) \
+    }
 #define HOOK_FD3(type, name, fd, type1, arg1, type2, arg2, type3, arg3) \
     static type (*real_ ## name)(type1, type2, type3); \
     type name(type1 arg1, type2 arg2, type3 arg3) { \