summaryrefslogtreecommitdiffstats
path: root/CRT.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-12-08 13:01:40 +0100
committerChristian Göttsche <cgzones@googlemail.com>2021-12-08 14:48:20 +0100
commit1da78b58187ba29ad618233b4cd38b159412909e (patch)
tree00e8353aad1ebac208347e39fe4981c977b27f73 /CRT.c
parent2ae19064791306b8cd7c741cf3431bde58d77136 (diff)
CRT: add debug printing function
Diffstat (limited to 'CRT.c')
-rw-r--r--CRT.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/CRT.c b/CRT.c
index 30236a3b..3a665496 100644
--- a/CRT.c
+++ b/CRT.c
@@ -13,6 +13,7 @@ in the source distribution for its full text.
#include <fcntl.h>
#include <langinfo.h>
#include <signal.h>
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -844,6 +845,16 @@ static void dumpStderr(void) {
stderrRedirectNewFd = -1;
}
+void CRT_debug_impl(const char* file, size_t lineno, const char* func, const char* fmt, ...) {
+ va_list args;
+
+ fprintf(stderr, "[%s:%zu (%s)]: ", file, lineno, func);
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+ fprintf(stderr, "\n");
+}
+
#else /* !NDEBUG */
static void redirectStderr(void) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy