aboutsummaryrefslogtreecommitdiff
path: root/src/core/panic.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2016-12-14 18:53:10 -0800
committerGarrett D'Amore <garrett@damore.org>2016-12-14 18:53:10 -0800
commit3583d5e407476b8836228c0abc52c400d74aba61 (patch)
tree113b6510b9f3d4f7eaffd331ecbd173724327c96 /src/core/panic.c
parente6476c5e4eac773aed4b76f16d3e76e7956c2468 (diff)
downloadnng-3583d5e407476b8836228c0abc52c400d74aba61.tar.gz
nng-3583d5e407476b8836228c0abc52c400d74aba61.tar.bz2
nng-3583d5e407476b8836228c0abc52c400d74aba61.zip
More robust platform definition support.
The idea is that someday it will be possible to just concatenate the entire set of source files into a single giant source file, for systems that want to work this way. As a result, the build system now compiles every file, although some of them will not have any definitions.
Diffstat (limited to 'src/core/panic.c')
-rw-r--r--src/core/panic.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/core/panic.c b/src/core/panic.c
index 52dcb8c8..43c25beb 100644
--- a/src/core/panic.c
+++ b/src/core/panic.c
@@ -50,7 +50,7 @@ show_backtrace(void)
return;
}
for (i = 1; i < nframes; i++) {
- nni_debug_out(lines[i]);
+ nni_println(lines[i]);
}
}
#endif
@@ -75,10 +75,17 @@ nni_panic(const char *fmt, ...)
(void) nni_vsnprintf(buf, sizeof (buf), fbuf, va);
va_end(va);
- nni_debug_out(buf);
- nni_debug_out("This message is indicative of a BUG.");
- nni_debug_out("Report this at http://github.com/nanomsg/nanomsg");
+ nni_println(buf);
+ nni_println("This message is indicative of a BUG.");
+ nni_println("Report this at http://github.com/nanomsg/nanomsg");
show_backtrace();
- nni_abort();
+ nni_plat_abort();
+}
+
+void
+nni_println(const char *msg)
+{
+ /* TODO: support redirection of this later. */
+ nni_plat_println(msg);
}