Module: xenomai-forge
Branch: rtdm-api-waitqueues
Commit: d1d4d9e23c563ce11c9203161755ffddc54cdfbc
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=d1d4d9e23c563ce11c9203161755ffddc54cdfbc

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Apr 15 10:40:27 2014 +0200

alchemy/init: assign explicit priority to constructor

---

 lib/alchemy/Makefile.am |    1 +
 lib/alchemy/Makefile.in |   10 +++++-----
 lib/alchemy/init.c      |    3 ++-
 lib/alchemy/init.h      |   25 +++++++++++++++++++++++++
 4 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/lib/alchemy/Makefile.am b/lib/alchemy/Makefile.am
index 5362695..788a4bb 100644
--- a/lib/alchemy/Makefile.am
+++ b/lib/alchemy/Makefile.am
@@ -4,6 +4,7 @@ libalchemy_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
 
 libalchemy_la_SOURCES =        \
        init.c          \
+       init.h          \
        internal.c      \
        internal.h      \
        reference.h     \
diff --git a/lib/alchemy/Makefile.in b/lib/alchemy/Makefile.in
index f194abb..0621cbb 100644
--- a/lib/alchemy/Makefile.in
+++ b/lib/alchemy/Makefile.in
@@ -131,7 +131,7 @@ am__uninstall_files_from_dir = { \
 am__installdirs = "$(DESTDIR)$(libdir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 libalchemy_la_LIBADD =
-am__libalchemy_la_SOURCES_DIST = init.c internal.c internal.h \
+am__libalchemy_la_SOURCES_DIST = init.c init.h internal.c internal.h \
        reference.h alarm.c alarm.h buffer.c buffer.h cond.c cond.h \
        event.c event.h heap.c heap.h mutex.c mutex.h queue.c queue.h \
        task.c task.h sem.c sem.h timer.c timer.h pipe.c pipe.h
@@ -385,10 +385,10 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 lib_LTLIBRARIES = libalchemy.la
 libalchemy_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
-libalchemy_la_SOURCES = init.c internal.c internal.h reference.h \
-       alarm.c alarm.h buffer.c buffer.h cond.c cond.h event.c \
-       event.h heap.c heap.h mutex.c mutex.h queue.c queue.h task.c \
-       task.h sem.c sem.h timer.c timer.h $(am__append_1)
+libalchemy_la_SOURCES = init.c init.h internal.c internal.h \
+       reference.h alarm.c alarm.h buffer.c buffer.h cond.c cond.h \
+       event.c event.h heap.c heap.h mutex.c mutex.h queue.c queue.h \
+       task.c task.h sem.c sem.h timer.c timer.h $(am__append_1)
 libalchemy_la_CPPFLAGS = \
        @XENO_USER_CFLAGS@                              \
        -I$(top_srcdir)/include                         \
diff --git a/lib/alchemy/init.c b/lib/alchemy/init.c
index ad2e72b..2052cc9 100644
--- a/lib/alchemy/init.c
+++ b/lib/alchemy/init.c
@@ -22,6 +22,7 @@
 #include <unistd.h>
 #include <getopt.h>
 #include <copperplate/init.h>
+#include "init.h"
 #include "timer.h"
 #include "task.h"
 #include "sem.h"
@@ -113,7 +114,7 @@ static struct copperskin alchemy_skin = {
        .help = alchemy_help,
 };
 
-static __attribute__ ((constructor)) void register_alchemy(void)
+static __libalchemy_ctor void register_alchemy(void)
 {
        copperplate_register_skin(&alchemy_skin);
 }
diff --git a/lib/alchemy/init.h b/lib/alchemy/init.h
new file mode 100644
index 0000000..ff95bb3
--- /dev/null
+++ b/lib/alchemy/init.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2014 Philippe Gerum <r...@xenomai.org>.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+ */
+#ifndef _ALCHEMY_INIT_H
+#define _ALCHEMY_INIT_H
+
+#define __LIBALCHEMY_CTOR_PRIO  300
+
+#define __libalchemy_ctor  __attribute__ 
((constructor(__LIBALCHEMY_CTOR_PRIO)))
+
+#endif /* _ALCHEMY_INIT_H */


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

Reply via email to