From 59e9fcac2052dc1727f380d2c8626514d07b1176 Mon Sep 17 00:00:00 2001 From: Iggy Date: Thu, 15 Aug 2013 13:08:29 -0500 Subject: [PATCH] Create QuietAssertMacros.c QuietAssertMacros --- QuietAssertMacros.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 QuietAssertMacros.c diff --git a/QuietAssertMacros.c b/QuietAssertMacros.c new file mode 100644 index 0000000..702aa3f --- /dev/null +++ b/QuietAssertMacros.c @@ -0,0 +1,28 @@ + + +#include +#include +#include +#include +#include "fishhook.h" + +int slient_fprintf(FILE * restrict stream, const char * restrict format, ...) +{ + if (strncmp(format, "AssertMacros:", 13) == 0) + { + return 0; + } + else + { + va_list args; + va_start(args, format); + int result = vfprintf(stream, format, args); + va_end(args); + return result; + } +} + +__attribute__((constructor)) void QuietAssertMacros(void) +{ + rebind_symbols((struct rebinding[1]){{"fprintf", slient_fprintf}}, 1); +}