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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Mar 19 19:27:41 2015 +0100

include/trank: add C bindings

---

 include/trank/native/alarm.h |    8 ++++++++
 include/trank/native/event.h |    8 ++++++++
 include/trank/native/misc.h  |    8 ++++++++
 include/trank/native/pipe.h  |    7 +++++++
 include/trank/native/task.h  |    7 +++++++
 include/trank/native/timer.h |    8 ++++++++
 include/trank/rtdm/rtdm.h    |    8 ++++++++
 7 files changed, 54 insertions(+)

diff --git a/include/trank/native/alarm.h b/include/trank/native/alarm.h
index 8096133..688d625 100644
--- a/include/trank/native/alarm.h
+++ b/include/trank/native/alarm.h
@@ -21,10 +21,18 @@
 #include <trank/trank.h>
 #include <alchemy/alarm.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 COMPAT_DECL(int, rt_alarm_create(RT_ALARM *alarm, const char *name));
 
 COMPAT_DECL(int, rt_alarm_wait(RT_ALARM *alarm));
 
 COMPAT_DECL(int, rt_alarm_delete(RT_ALARM *alarm));
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _XENOMAI_TRANK_NATIVE_ALARM_H */
diff --git a/include/trank/native/event.h b/include/trank/native/event.h
index 037ddd0..800cbca 100644
--- a/include/trank/native/event.h
+++ b/include/trank/native/event.h
@@ -20,6 +20,10 @@
 
 #include <alchemy/event.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 COMPAT_DECL(int, rt_event_create(RT_EVENT *event, const char *name,
                                 unsigned long ivalue, int mode));
 
@@ -70,4 +74,8 @@ int rt_event_wait(RT_EVENT *event,
 
 #endif /* __XENO_COMPAT__ */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _XENOMAI_TRANK_NATIVE_EVENT_H */
diff --git a/include/trank/native/misc.h b/include/trank/native/misc.h
index b5255fa..bf0ed17 100644
--- a/include/trank/native/misc.h
+++ b/include/trank/native/misc.h
@@ -28,6 +28,10 @@
 typedef struct rt_ioregion {
 } RT_IOREGION;
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 __attribute__((__deprecated__))
 static inline int rt_io_get_region(RT_IOREGION *iorn,
                                   const char *name,
@@ -46,4 +50,8 @@ int rt_io_put_region(RT_IOREGION *iorn)
        return -ENOSYS;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _XENOMAI_TRANK_NATIVE_MISC_H */
diff --git a/include/trank/native/pipe.h b/include/trank/native/pipe.h
index 95f8ae9..42f56a5 100644
--- a/include/trank/native/pipe.h
+++ b/include/trank/native/pipe.h
@@ -21,8 +21,15 @@
 #include <alchemy/pipe.h>
 #include <trank/trank.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 COMPAT_DECL(int, rt_pipe_create(RT_PIPE *pipe,
                                const char *name,
                                int minor, size_t poolsize));
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* _XENOMAI_TRANK_NATIVE_PIPE_H */
diff --git a/include/trank/native/task.h b/include/trank/native/task.h
index f2fb1dd..5c4d354 100644
--- a/include/trank/native/task.h
+++ b/include/trank/native/task.h
@@ -31,6 +31,10 @@
 #define T_CPU(cpu) (1 << (24 + (cpu & 7)))
 #define T_CPUMASK  0xff000000
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 __attribute__((__deprecated__))
 static inline int rt_task_notify(RT_TASK *task, rt_sigset_t sigs)
 {
@@ -47,5 +51,8 @@ COMPAT_DECL(int, rt_task_spawn(RT_TASK *task, const char 
*name,
 
 COMPAT_DECL(int, rt_task_set_periodic(RT_TASK *task,
                                      RTIME idate, RTIME period));
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* _XENOMAI_TRANK_NATIVE_TASK_H */
diff --git a/include/trank/native/timer.h b/include/trank/native/timer.h
index 9ab6e8e..7ccba1c 100644
--- a/include/trank/native/timer.h
+++ b/include/trank/native/timer.h
@@ -24,6 +24,10 @@
 
 #define TM_ONESHOT  0
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 __attribute__((__deprecated__))
 static inline int rt_timer_set_mode(RTIME nstick)
 {
@@ -36,4 +40,8 @@ static inline int rt_timer_set_mode(RTIME nstick)
        return 0;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _XENOMAI_TRANK_NATIVE_TIMER_H */
diff --git a/include/trank/rtdm/rtdm.h b/include/trank/rtdm/rtdm.h
index 5fa36b2..9a0c965 100644
--- a/include/trank/rtdm/rtdm.h
+++ b/include/trank/rtdm/rtdm.h
@@ -20,6 +20,10 @@
 
 #include_next <rtdm/rtdm.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifndef RTDM_NO_DEFAULT_USER_API
 
 #define rt_dev_call(__call, __args...) \
@@ -165,4 +169,8 @@ static inline ssize_t rt_dev_read(int fd, void *buf, size_t 
len)
 
 #endif /* !RTDM_NO_DEFAULT_USER_API */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _XENOMAI_TRANK_RTDM_RTDM_H */


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

Reply via email to