X-Git-Url: https://ruderich.org/simon/gitweb/?p=coloredstderr%2Fcoloredstderr.git;a=blobdiff_plain;f=src%2Fhookmacros.h;fp=src%2Fhookmacros.h;h=b8b70ec03bf035fc26c927de13e5caaaa7331daa;hp=b5e2cb0b1fdb93d7ab95cb58012b6d5177ec3a00;hb=7adfbfd2cf1d46144c41a75aa501938607a316b5;hpb=d8be625da928025e96417c1b62f3336251204cef diff --git a/src/hookmacros.h b/src/hookmacros.h index b5e2cb0..b8b70ec 100644 --- a/src/hookmacros.h +++ b/src/hookmacros.h @@ -117,6 +117,13 @@ _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) { \