From 8f4416dfcf873d7a6b8152f1218ee163f5ee76d5 Mon Sep 17 00:00:00 2001 From: telleriam Date: Wed, 20 Feb 2008 15:49:37 +0000 Subject: [PATCH] Adding FRSH_CPP_BEGIN|END_DECLS to public .h files git-svn-id: http://www.frescor.org/private/svn/frescor/frsh/trunk/include@1024 35b4ef3e-fd22-0410-ab77-dab3279adceb --- eat.h | 5 +++++ frsh.h | 3 +++ frsh_configuration_parameters.h | 4 ++++ frsh_core.h | 6 ++++-- frsh_core_types.h | 3 +++ frsh_cpp_macros.h | 17 +++++++++++++++++ frsh_debug_and_trace.h | 4 ++++ frsh_debug_and_trace_types.h | 5 +++-- frsh_distributed.h | 5 +++++ frsh_distributed_types.h | 4 ++++ frsh_energy_management.h | 3 +++ frsh_energy_management_types.h | 3 +++ frsh_feedback_control.h | 4 ++++ frsh_feedback_control_types.h | 3 +++ frsh_hierarchical.h | 3 +++ frsh_hierarchical_types.h | 4 ++++ frsh_implementation_specific.h | 3 +++ frsh_implementation_specific_types.h | 4 ++++ frsh_memory_management.h | 4 ++++ frsh_opaque_types.h | 3 +++ frsh_shared_objects.h | 3 +++ frsh_shared_objects_types.h | 5 +++++ frsh_spare_capacity.h | 3 +++ frsh_spare_capacity_types.h | 6 ++++++ frsh_thread_attrs.h | 6 ++++++ frsh_time.h | 6 ++++++ 26 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 frsh_cpp_macros.h diff --git a/eat.h b/eat.h index c7795d5..00ed323 100644 --- a/eat.h +++ b/eat.h @@ -51,12 +51,17 @@ #ifndef _EAT_H #define _EAT_H + #include +#include +FRSH_CPP_BEGIN_DECLS /** * @file eat.h **/ extern void inline eat(const struct timespec *cpu_time); +FRSH_CPP_END_DECLS + #endif diff --git a/frsh.h b/frsh.h index 5190444..fde0fdc 100644 --- a/frsh.h +++ b/frsh.h @@ -86,6 +86,8 @@ #include "fosa.h" +#include "frsh_cpp_macros.h" + #include "frsh_configuration_parameters.h" /* We include all the types because they are needed for the @@ -114,6 +116,7 @@ #include "frsh_memory_management.h" #include "frsh_energy_management.h" +#include "frsh_debug_and_trace.h" #ifndef FRSH_HIERARCHICAL_MODULE_SUPPORTED #define FRSH_HIERARCHICAL_MODULE_SUPPORTED 0 diff --git a/frsh_configuration_parameters.h b/frsh_configuration_parameters.h index e2504cf..fe9e0ee 100644 --- a/frsh_configuration_parameters.h +++ b/frsh_configuration_parameters.h @@ -73,6 +73,8 @@ #include +FRSH_CPP_BEGIN_DECLS + /** * @file frsh_configuration_parameters.h * @@ -356,5 +358,7 @@ int frsh_priority_map (unsigned long plevel); /*@}*/ +FRSH_CPP_END_DECLS + #endif /* _FRSH_CONFIGURATION_PARAMETERS_H_ */ diff --git a/frsh_core.h b/frsh_core.h index 549bd1a..d3db7db 100644 --- a/frsh_core.h +++ b/frsh_core.h @@ -84,6 +84,9 @@ #include "frsh_core_types.h" #include "frsh_spare_capacity.h" + +FRSH_CPP_BEGIN_DECLS + /** * @defgroup core Core module * @@ -1521,7 +1524,6 @@ int frsh_service_thread_get_data //threads - - +FRSH_CPP_END_DECLS #endif // _FRSH_CORE_H_ diff --git a/frsh_core_types.h b/frsh_core_types.h index 1afe99b..e727fdd 100644 --- a/frsh_core_types.h +++ b/frsh_core_types.h @@ -84,6 +84,8 @@ #include "frsh_distributed_types.h" #include "frsh_error.h" +FRSH_CPP_BEGIN_DECLS + /** * @file frsh_core_types.h **/ @@ -211,5 +213,6 @@ typedef FRSH_SYNCHOBJ_HANDLE_T_OPAQUE frsh_synchobj_handle_t; /*@}*/ +FRSH_CPP_END_DECLS #endif /* !FRSH_CORE_TYPES_H_ */ diff --git a/frsh_cpp_macros.h b/frsh_cpp_macros.h new file mode 100644 index 0000000..5664162 --- /dev/null +++ b/frsh_cpp_macros.h @@ -0,0 +1,17 @@ +#ifndef _FRSH_CPP_MACROS_H_ +#define _FRSH_CPP_MACROS_H_ + +#if defined(__cplusplus) +#define FRSH_CPP_BEGIN_DECLS extern "C" { +#else +#define FRSH_CPP_BEGIN_DECLS +#endif + +#if defined(__cplusplus) +#define FRSH_CPP_END_DECLS } +#else +#define FRSH_CPP_END_DECLS +#endif + +#endif // _FRSH_CPP_MACROS_H_ + diff --git a/frsh_debug_and_trace.h b/frsh_debug_and_trace.h index ad03ff4..9d19e9e 100644 --- a/frsh_debug_and_trace.h +++ b/frsh_debug_and_trace.h @@ -82,6 +82,8 @@ #include "fosa_configuration_parameters.h" /* FOSA_CLOCK_REALTIME */ #include "fosa_clocks_and_timers.h" +FRSH_CPP_BEGIN_DECLS + // Tune the following FLAGS to select the debugging messages to be generated #define FRSH_TRACE_CALLBACKS false #define FRSH_TRACE_SERVICE_TH false @@ -158,4 +160,6 @@ static inline long int FRSH_TIMESPEC_TO_RELATIVE_MSECS(const struct timespec *ts **/ void FRSH_TRACE(bool is_active, const char *format, ...); +FRSH_CPP_END_DECLS + #endif diff --git a/frsh_debug_and_trace_types.h b/frsh_debug_and_trace_types.h index 1f9c902..ab3c164 100644 --- a/frsh_debug_and_trace_types.h +++ b/frsh_debug_and_trace_types.h @@ -74,6 +74,8 @@ #ifndef FRSH_DEBUG_AND_TRACE_TYPES_H_ #define FRSH_DEBUG_AND_TRACE_TYPES_H_ +FRSH_CPP_BEGIN_DECLS + /** identifier of a trace point **/ typedef int frsh_trace_point_id_t; @@ -82,7 +84,6 @@ typedef int frsh_trace_point_id_t; #define FRSH_TRACE_POINT_ID_MAX 10 - - +FRSH_CPP_END_DECLS #endif /* !FRSH_DEBUG_AND_TRACE_TYPES_H_ */ diff --git a/frsh_distributed.h b/frsh_distributed.h index bb501e2..1c5e4ca 100644 --- a/frsh_distributed.h +++ b/frsh_distributed.h @@ -71,6 +71,7 @@ #ifndef _FRSH_DISTRIBUTED_H_ #define _FRSH_DISTRIBUTED_H_ + /** * @file frsh_distributed.h **/ @@ -79,6 +80,8 @@ #include "frsh_distributed_types.h" #include "frsh_core_types.h" +FRSH_CPP_BEGIN_DECLS + /** * @defgroup distributed Distributed module * @@ -714,4 +717,6 @@ int frsh_receive_endpoint_get_status /*@}*/ +FRSH_CPP_END_DECLS + #endif // _FRSH_DISTRIBUTED_H_ diff --git a/frsh_distributed_types.h b/frsh_distributed_types.h index 7b87887..dcd774b 100644 --- a/frsh_distributed_types.h +++ b/frsh_distributed_types.h @@ -78,6 +78,8 @@ #include "frsh_opaque_types.h" +FRSH_CPP_BEGIN_DECLS + /** * @addtogroup distributed * @@ -171,4 +173,6 @@ typedef enum { /*@}*/ +FRSH_CPP_END_DECLS + #endif /* !FRSH_DISTRIBUTED_TYPES_H_ */ diff --git a/frsh_energy_management.h b/frsh_energy_management.h index b7287e1..626c226 100644 --- a/frsh_energy_management.h +++ b/frsh_energy_management.h @@ -78,6 +78,7 @@ #include "frsh_energy_management_types.h" #include "frsh_core_types.h" +FRSH_CPP_BEGIN_DECLS #define FRSH_ENERGY_MANAGEMENT_MODULE_SUPPORTED 1 @@ -280,4 +281,6 @@ int frsh_battery_get_expiration(struct timespec *expiration); /*@}*/ +FRSH_CPP_END_DECLS + #endif /* _FRSH_ENERGY_MANAGEMENT_H_ */ diff --git a/frsh_energy_management_types.h b/frsh_energy_management_types.h index 63e147d..212a4c1 100644 --- a/frsh_energy_management_types.h +++ b/frsh_energy_management_types.h @@ -74,6 +74,8 @@ #include #include "frsh_core_types.h" +FRSH_CPP_BEGIN_DECLS + /** * @file frsh_energy_management_types.h **/ @@ -114,5 +116,6 @@ typedef struct { frsh_utilization_line_pow_t utilizations[FRSH_MAX_N_UTILIZATION_VALUES]; } frsh_utilization_set_pow_t; +FRSH_CPP_END_DECLS #endif /* !FRSH_ENERGY_MANAGEMENT_TYPES_H_ */ diff --git a/frsh_feedback_control.h b/frsh_feedback_control.h index a655a5d..af697fc 100644 --- a/frsh_feedback_control.h +++ b/frsh_feedback_control.h @@ -78,6 +78,7 @@ //#include "frsh_feedback_control_types.h" #include "frsh_core_types.h" +FRSH_CPP_BEGIN_DECLS #define FRSH_FEEDBACKCTRL_MODULE_SUPPORTED 1 @@ -208,4 +209,7 @@ int frsh_feedback_get_actual_budget(frsh_vres_id_t vres_id, struct timespec *bud /*@}*/ + +FRSH_CPP_END_DECLS + #endif diff --git a/frsh_feedback_control_types.h b/frsh_feedback_control_types.h index fedb8f8..a98df8b 100644 --- a/frsh_feedback_control_types.h +++ b/frsh_feedback_control_types.h @@ -76,6 +76,7 @@ #include "frsh_opaque_types.h" #include "frsh_configuration_parameters.h" +FRSH_CPP_BEGIN_DECLS /** * @file frsh_feedback_control_types.h **/ @@ -94,4 +95,6 @@ typedef int frsh_spare_subset_t; /*@}*/ +FRSH_CPP_END_DECLS + #endif /* !FRSH_FEEDBACK_CONTROL_TYPES_H_ */ diff --git a/frsh_hierarchical.h b/frsh_hierarchical.h index ea04e22..179ce02 100644 --- a/frsh_hierarchical.h +++ b/frsh_hierarchical.h @@ -76,6 +76,7 @@ #include "frsh_hierarchical_types.h" #include "frsh_core.h" +FRSH_CPP_BEGIN_DECLS #define FRSH_HIERARCHICAL_MODULE_SUPPORTED 1 @@ -272,4 +273,6 @@ int frsh_thread_get_local_sched_params(frsh_thread_id_t thread, /*}*/ +FRSH_CPP_END_DECLS + #endif // _FRSH_HIERARCHICAL_H_ diff --git a/frsh_hierarchical_types.h b/frsh_hierarchical_types.h index c2b76d9..ee2d16e 100644 --- a/frsh_hierarchical_types.h +++ b/frsh_hierarchical_types.h @@ -77,6 +77,8 @@ #include +FRSH_CPP_BEGIN_DECLS + /** * @addtogroup hierarchical * @@ -137,4 +139,6 @@ typedef void * frsh_sched_init_info_t; /*}*/ +FRSH_CPP_END_DECLS + #endif /* !FRSH_HIERARCHICAL_TYPES_H_ */ diff --git a/frsh_implementation_specific.h b/frsh_implementation_specific.h index 3ba3009..9af328d 100644 --- a/frsh_implementation_specific.h +++ b/frsh_implementation_specific.h @@ -76,6 +76,8 @@ #define FRSH_IMPLEMENTATION_SPECIFIC_MODULE_SUPPORTED 1 +FRSH_CPP_BEGIN_DECLS + /** * @file frsh_implementation_specific.h * @@ -210,5 +212,6 @@ int frsh_sharedobj_get_preemption_level(frsh_sharedobj_handle_t obj_handle, /*@}*/ +FRSH_CPP_END_DECLS #endif // _FRSH_IMPLEMENTATION_SPECIFIC_H_ diff --git a/frsh_implementation_specific_types.h b/frsh_implementation_specific_types.h index 8383dab..aadbd1a 100644 --- a/frsh_implementation_specific_types.h +++ b/frsh_implementation_specific_types.h @@ -72,6 +72,8 @@ #ifndef FRSH_IMPLEMENTATION_SPECIFIC_TYPES_H_ #define FRSH_IMPLEMENTATION_SPECIFIC_TYPES_H_ +FRSH_CPP_BEGIN_DECLS + /** * @file frsh_implementation_specific_types.h **/ @@ -87,5 +89,7 @@ typedef unsigned long frsh_preemption_level_t; // range 1..2**32-1 /*@}*/ +FRSH_CPP_END_DECLS + #endif /* !FRSH_IMPLEMENTATION_SPECIFIC_TYPES_H_ */ diff --git a/frsh_memory_management.h b/frsh_memory_management.h index f0577fa..c5d3bc3 100644 --- a/frsh_memory_management.h +++ b/frsh_memory_management.h @@ -78,6 +78,8 @@ #define FRSH_MEMORY_MANAGEMENT_SUPPORTED 1 +FRSH_CPP_BEGIN_DECLS + /** * @file frsh_memory_management.h **/ @@ -186,4 +188,6 @@ int frsh_vres_memfree(frsh_vres_id_t vres_id, /*@}*/ +FRSH_CPP_END_DECLS + #endif /* !FRSH_MEMORY_MANAGEMENT_H_ */ diff --git a/frsh_opaque_types.h b/frsh_opaque_types.h index e12a8ad..c6ee66d 100644 --- a/frsh_opaque_types.h +++ b/frsh_opaque_types.h @@ -73,6 +73,7 @@ #ifndef _FRSH_OPAQUE_TYPES_H_ #define _FRSH_OPAQUE_TYPES_H_ +FRSH_CPP_BEGIN_DECLS /** * @file frsh_opaque_types.h @@ -234,4 +235,6 @@ typedef int FRSH_RECEIVE_ENDPOINT_T_OPAQUE; /*@}*/ +FRSH_CPP_END_DECLS + #endif // _FRSH_OPAQUE_TYPES_H_ diff --git a/frsh_shared_objects.h b/frsh_shared_objects.h index f48dc9d..6492aad 100644 --- a/frsh_shared_objects.h +++ b/frsh_shared_objects.h @@ -76,6 +76,7 @@ #include "frsh_shared_objects_types.h" #include "frsh_core_types.h" +FRSH_CPP_BEGIN_DECLS #define FRSH_SHAREDOBJS_MODULE_SUPPORTED 1 @@ -702,4 +703,6 @@ int frsh_contract_get_csects /*@}*/ /* For shared_objects group */ +FRSH_CPP_END_DECLS + #endif // _FRSH_SHARED_OBJECTS_H_ diff --git a/frsh_shared_objects_types.h b/frsh_shared_objects_types.h index 8287b22..b0f8666 100644 --- a/frsh_shared_objects_types.h +++ b/frsh_shared_objects_types.h @@ -76,6 +76,8 @@ #include "frsh_opaque_types.h" #include "frsh_configuration_parameters.h" +FRSH_CPP_BEGIN_DECLS + /** * @file frsh_shared_objects_types.h **/ @@ -157,4 +159,7 @@ typedef struct { /*@}*/ + +FRSH_CPP_END_DECLS + #endif /* !FRSH_SHARED_OBJECTS_TYPES_H_ */ diff --git a/frsh_spare_capacity.h b/frsh_spare_capacity.h index 2b14098..700797c 100644 --- a/frsh_spare_capacity.h +++ b/frsh_spare_capacity.h @@ -77,6 +77,7 @@ #include "frsh_core_types.h" #include "frsh_core.h" +FRSH_CPP_BEGIN_DECLS /** * @file frsh_spare_capacity.h @@ -340,4 +341,6 @@ int frsh_vres_decrease_capacity(frsh_vres_id_t vres, /*@}*/ +FRSH_CPP_END_DECLS + #endif // _FRSH_SPARE_CAPACITY_H_ diff --git a/frsh_spare_capacity_types.h b/frsh_spare_capacity_types.h index 9da5c84..d002aa9 100644 --- a/frsh_spare_capacity_types.h +++ b/frsh_spare_capacity_types.h @@ -74,6 +74,8 @@ #include +FRSH_CPP_BEGIN_DECLS + /** * @file frsh_spare_capacity_types.h **/ @@ -114,4 +116,8 @@ typedef struct { (frsh_utilization_set_t *)NULL /*@}*/ + +FRSH_CPP_END_DECLS + + #endif /* !FRSH_SPARE_CAPACITY_TYPES_H_ */ diff --git a/frsh_thread_attrs.h b/frsh_thread_attrs.h index 014bdb6..562b2c8 100644 --- a/frsh_thread_attrs.h +++ b/frsh_thread_attrs.h @@ -71,6 +71,11 @@ #ifndef _FRSH_THREADS_H_ #define _FRSH_THREADS_H_ +#include "frsh_core_types.h" +#include "frsh_core.h" + +FRSH_CPP_BEGIN_DECLS + /** * @file frsh_thread_attrs.h **/ @@ -161,6 +166,7 @@ static inline int frsh_thread_attr_get_stacksize /*@}*/ +FRSH_CPP_END_DECLS #endif diff --git a/frsh_time.h b/frsh_time.h index a2eb6ae..8e71621 100644 --- a/frsh_time.h +++ b/frsh_time.h @@ -10,6 +10,11 @@ #ifndef FRSH_TIME_H_ #define FRSH_TIME_H_ +#include +#include + +FRSH_CPP_BEGIN_DECLS + /** * frsh_eat() * @@ -20,5 +25,6 @@ static void inline frsh_eat(const struct timespec *cpu_time) fosa_eat(cpu_time); } +FRSH_CPP_END_DECLS #endif /* !FOSA_TIME_H_ */ -- 2.39.2