Module: xenomai-forge
Branch: next
Commit: 9fed5972730b157e0ead8077da580f8f85d32f22
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=9fed5972730b157e0ead8077da580f8f85d32f22

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Mar  9 11:02:05 2014 +0100

boilerplate/ancillaries: expose early warning/panic handlers

---

 include/boilerplate/ancillaries.h |    4 ++++
 lib/boilerplate/ancillaries.c     |   12 ++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/include/boilerplate/ancillaries.h 
b/include/boilerplate/ancillaries.h
index fc04f2f..da1e827 100644
--- a/include/boilerplate/ancillaries.h
+++ b/include/boilerplate/ancillaries.h
@@ -55,11 +55,15 @@ void __printout(const char *name,
 void __panic(const char *name,
             const char *fmt, va_list ap);
 
+void early_panic(const char *fmt, ...);
+
 void panic(const char *fmt, ...);
 
 void __warning(const char *name,
               const char *fmt, va_list ap);
 
+void early_warning(const char *fmt, ...);
+
 void warning(const char *fmt, ...);
 
 const char *symerror(int errnum);
diff --git a/lib/boilerplate/ancillaries.c b/lib/boilerplate/ancillaries.c
index 59d49c3..35bd401 100644
--- a/lib/boilerplate/ancillaries.c
+++ b/lib/boilerplate/ancillaries.c
@@ -150,8 +150,7 @@ void __run_cleanup_block(struct cleanup_block *cb)
        cb->handler(cb->arg);
 }
 
-__attribute__ ((weak))
-void panic(const char *fmt, ...)
+void early_panic(const char *fmt, ...)
 {
        va_list ap;
 
@@ -160,8 +159,10 @@ void panic(const char *fmt, ...)
        va_end(ap);
 }
 
-__attribute__ ((weak))
-void warning(const char *fmt, ...)
+void panic(const char *fmt, ...)
+__attribute__((alias("early_panic"), weak));
+
+void early_warning(const char *fmt, ...)
 {
        va_list ap;
 
@@ -170,6 +171,9 @@ void warning(const char *fmt, ...)
        va_end(ap);
 }
 
+void warning(const char *fmt, ...)
+__attribute__((alias("early_warning"), weak));
+
 char *generate_name(char *buf, const char *radix,
                    struct name_generator *ngen)
 {


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to