You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/11/10 22:39:57 UTC

[50/50] [abbrv] incubator-mynewt-core git commit: sysinit - Fix custom panic function.

sysinit - Fix custom panic function.

There were two issues associated with specifying a custom panic function
in sysinit's syscfg:

1. The custom function never got used; the macro check to determine if a
custom function has been specified was wrong.

2. It was tedious to ensure a prototype for the custom panic function
had been declared wherever SYSINIT_PANIC() gets called.  Now, a
prototype is automatically declared by SYSINIT_PANIC().


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/8694d49e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/8694d49e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/8694d49e

Branch: refs/heads/master
Commit: 8694d49e83a63c5daf400bc9411dd020012c61a2
Parents: c28fbdd
Author: Christopher Collins <cc...@apache.org>
Authored: Thu Nov 10 14:21:03 2016 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Thu Nov 10 14:21:03 2016 -0800

----------------------------------------------------------------------
 sys/sysinit/include/sysinit/sysinit.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/8694d49e/sys/sysinit/include/sysinit/sysinit.h
----------------------------------------------------------------------
diff --git a/sys/sysinit/include/sysinit/sysinit.h b/sys/sysinit/include/sysinit/sysinit.h
index f28a259..e7a5d11 100644
--- a/sys/sysinit/include/sysinit/sysinit.h
+++ b/sys/sysinit/include/sysinit/sysinit.h
@@ -33,10 +33,11 @@ extern "C" {
 
 typedef void sysinit_panic_fn(const char *file, int line);
 
-#if !MYNEWT_VAL(SYSINIT_PANIC_FN)
+#ifndef MYNEWT_VAL_SYSINIT_PANIC_FN
 #include <assert.h>
 #define SYSINIT_PANIC() assert(0)
 #else
+void MYNEWT_VAL(SYSINIT_PANIC_FN)(const char *file, int line);
 #define SYSINIT_PANIC() MYNEWT_VAL(SYSINIT_PANIC_FN)(__FILE__, __LINE__)
 #endif