]> rtime.felk.cvut.cz Git - frescor/fosa.git/commitdiff
Adding FOSA_CPP_BEING|END_DECLS to allow interfacing with C++
authortelleriam <telleriam@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Wed, 20 Feb 2008 15:57:07 +0000 (15:57 +0000)
committertelleriam <telleriam@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Wed, 20 Feb 2008 15:57:07 +0000 (15:57 +0000)
git-svn-id: http://www.frescor.org/private/svn/frescor/fosa/trunk@1025 35b4ef3e-fd22-0410-ab77-dab3279adceb

13 files changed:
include/fosa.h
include/fosa_app_def_sched.h
include/fosa_clocks_and_timers.h
include/fosa_configuration_parameters.h
include/fosa_cpp_macros.h [new file with mode: 0644]
include/fosa_long_jump.h
include/fosa_mutexes_and_condvars.h
include/fosa_opaque_types.h
include/fosa_threads_and_signals.h
include/fosa_time.h
include/fosa_types.h
include/timespec_operations.h
src_marte/fosa_clocks_and_timers.c

index bcd5e6e7c5d21172c1219631046daa06ee237d2d..032bfddd8a59ffe94d614cea507793b177761f71 100644 (file)
@@ -67,6 +67,7 @@
 #ifndef        _FOSA_H_
 #define        _FOSA_H_
 
+#include "fosa_cpp_macros.h"
 #include "fosa_configuration_parameters.h"
 #include "fosa_types.h"
 
  *         -DOSE
  *         -DMARTE_OS
  *         -DAQuoSA
- *         -DPARTIKLE
  *
  * This module contains all other modules that are internal to the
  * FRSH implementation.
index e1c8aa2fdfdfb0cc0bb4cc1f73f450d51fcf398c..ecb202b2122ac5484cd23ce8fcc4d12006856218 100644 (file)
@@ -69,6 +69,8 @@
 
 #include "fosa_types.h"
 
+FOSA_CPP_BEGIN_DECLS
+
 /**
  * @defgroup appdefsched Application Defined Scheduling
  * @ingroup fosa
@@ -647,5 +649,6 @@ int fosa_ads_invoke_withdata
 
 /*}*/
 
+FOSA_CPP_END_DECLS
 
 #endif             /* !FOSA_APP_DEF_SCHED_H_ */
index 53f4d5560b4178acd533009ade18dd230a91a325..d21caac82ec01f2d4180edee96ad75fdcb44e1c1 100644 (file)
@@ -70,6 +70,8 @@
 #include "fosa_types.h"
 #include "fosa_configuration_parameters.h"
 
+FOSA_CPP_BEGIN_DECLS
+
 /**
  * @defgroup clocksandtimers Clocks and Timers
  * @ingroup fosa
@@ -285,5 +287,6 @@ int fosa_timer_disarm(fosa_timer_id_t timerid, struct timespec
 
 /*@}*/
 
+FOSA_CPP_END_DECLS
 
 #endif             /* !FOSA_CLOCKS_AND_TIMERS_H_ */
index e5e308c3828ba83969abb6fddaee6d4dbfd380a3..b6a684432f2c639dd7ccdf74c27d41c046749a94 100644 (file)
@@ -67,7 +67,7 @@
 #ifndef        _FOSA_CONFIG_PARAM_H_
 #define        _FOSA_CONFIG_PARAM_H_
 
-
+FOSA_CPP_BEGIN_DECLS
 
 // the realtime clock used internally by the FRSH implementation
 // as the time basis for all timed services
 // The preemption level of the ADS scheduler thread
 #define FOSA_ADS_SCHEDULER_LEVEL 0xffff
 
+FOSA_CPP_END_DECLS
+
 #endif // _FOSA_CONFIG_PARAM_H_
diff --git a/include/fosa_cpp_macros.h b/include/fosa_cpp_macros.h
new file mode 100644 (file)
index 0000000..f9d3bfe
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef _FOSA_CPP_MACROS_H_
+#define _FOSA_CPP_MACROS_H_
+
+#if defined(__cplusplus)
+#define FOSA_CPP_BEGIN_DECLS  extern "C" {
+#else
+#define FOSA_CPP_BEGIN_DECLS
+#endif
+
+#if defined(__cplusplus)
+#define FOSA_CPP_END_DECLS }
+#else
+#define FOSA_CPP_END_DECLS
+#endif
+
+#endif // _FOSA_CPP_MACROS_H_
index b68b8a18668298aea8e3d6fab36d481acc4d2080..e04b5e89d52327ccd7905c1b2f284d56a06ac108 100644 (file)
@@ -70,6 +70,8 @@
 #include "fosa_types.h"
 #include "fosa_opaque_types.h"
 
+FOSA_CPP_BEGIN_DECLS
+
 /**
  * @defgroup longjumps Long Jumps
  * @ingroup fosa
@@ -205,4 +207,6 @@ int fosa_long_jump_install_handler
 /*@}*/
 
 
+FOSA_CPP_END_DECLS
+
 #endif             /* !FOSA_LONG_JUMP */
index 6b198e7be82a875f0fd334249a207cc42d427d2f..a2cfadef4e799e532619627f6e674135f1199250 100644 (file)
@@ -69,6 +69,8 @@
 
 #include "fosa_types.h"
 
+FOSA_CPP_BEGIN_DECLS
+
 /**
  * @defgroup mutexesandcondvars Mutexes and Condvars
  * @ingroup fosa
@@ -357,6 +359,6 @@ int fosa_cond_timedwait(fosa_cond_t *cond, fosa_mutex_t *mutex,
 /*@}*/
 
 
-
+FOSA_CPP_END_DECLS
 
 #endif             /* !FOSA_MUTEX_AND_CONDVARS_H_ */
index 21af0c0298f83661aeae298cf723437d3ea6e658..5f96806bf233e2c9bb13f142bfb604bf23f24e8c 100644 (file)
@@ -70,6 +70,8 @@
 
 #include <stdbool.h>
 
+#include "fosa_cpp_macros.h"
+
 ///////////////////////  MARTE_OS /////////////////////////////
 
 #ifdef MARTE_OS
@@ -80,6 +82,8 @@
 #include <sched.h>
 #include <errno.h>
 
+FOSA_CPP_BEGIN_DECLS
+
 /* Time */
 /********/
 // typedef struct timespec fosa_rel_time_t;
@@ -491,7 +495,7 @@ typedef int FOSA_COND_T_OPAQUE;
 #endif /* DUMMY */
 //////////////////////////End of DUMMY_OS ////////////////////////////////////
 
-
+FOSA_CPP_END_DECLS
 
 
 #endif // _FOSA_OPAQUE_TYPES_H_
index a6d22856a3d81729fb329f98e36f7fff4fb590e0..b2d685f24c5f2f2cc179a241882fec677e56236c 100644 (file)
 
 #include "fosa_types.h"
 
+
+FOSA_CPP_BEGIN_DECLS
+
+
 /**
  * @defgroup threadandsignals Thread and Signals
  * @ingroup fosa
@@ -503,5 +507,6 @@ int fosa_signal_queue
 
 /*}*/
 
+FOSA_CPP_END_DECLS
 
 #endif             /* !FOSA_THREAD_AND_SIGNALS_H_ */
index f3ff8c1d597b774d95ec5972f09ee84ae99f6bd8..6c832507348071f60e89df68ddc06efc09cfcb5e 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef        FOSA_TIME_H_
 #define        FOSA_TIME_H_
 
+FOSA_CPP_BEGIN_DECLS
+
 /**
  * fosa_eat()
  *
@@ -17,5 +19,6 @@
  **/
 void inline fosa_eat(const struct timespec *cpu_time);
 
+FOSA_CPP_END_DECLS
 
 #endif             /* !FOSA_TIME_H_ */
index d46651a10055ef4f60ebbe49a506409f2b354f66..3968aae8049462968f7ce7878df573eadd3c560b 100644 (file)
@@ -68,6 +68,9 @@
 #define        _FOSA_TYPES_H_
 
 #include "fosa_opaque_types.h"
+
+FOSA_CPP_BEGIN_DECLS
+
 /**
  * @addtogroup threadandsignals
  *
@@ -403,6 +406,7 @@ typedef struct {
 typedef     FOSA_LONG_JUMP_CONTEXT_T_OPAQUE    fosa_long_jump_context_t; 
 
 
+FOSA_CPP_END_DECLS
 
 
 #endif // _FOSA_TYPES_H_
index 2a4cf272774e09a18a87377aabed39ab5787b589..8788f7074fe32af8778b5cf4cc62024a44034744 100644 (file)
 #include <time.h> // for timespec
 #include <string.h> // for memset
 
+FOSA_CPP_BEGIN_DECLS
+
 #define smaller_timespec(t1, t2) \
  ( \
   (t1)->tv_sec < (t2)->tv_sec || ((t1)->tv_sec == (t2)->tv_sec &&   \
@@ -266,4 +268,6 @@ static inline struct timespec d2t(double time)
     return tmp;
 }
 
+FOSA_CPP_BEGIN_DECLS
+
 #endif /* _MARTE_MISC_TIMESPEC_OPERATIONS_H_ */
index 03f0b68e2c8d0a685d528fa3648cd6bc08af0b4c..53fac890cad642fae1007593065023f5251e753a 100644 (file)
 //================================================
 
 
-#include "fosa_clocks_and_timers.h"
 #include <pthread.h>
 #include <time.h>
 #include <stdio.h>
 
+#include "fosa_clocks_and_timers.h"
+
 static const struct timespec zero_time={0,0};