From 6946751f1f5ce1ed7ed5648a8e259c68f718223c Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Mon, 27 Aug 2012 13:27:32 -0400 Subject: [PATCH] Fix: C++ support to API header files Signed-off-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers --- include/babeltrace/clock-types.h | 8 ++++++++ include/babeltrace/context.h | 8 ++++++++ include/babeltrace/ctf/callbacks.h | 8 ++++++++ include/babeltrace/ctf/events.h | 8 ++++++++ include/babeltrace/ctf/iterator.h | 8 ++++++++ include/babeltrace/format.h | 7 +++++++ include/babeltrace/iterator.h | 8 ++++++++ include/babeltrace/list.h | 7 +++++++ include/babeltrace/trace-collection.h | 8 ++++++++ include/babeltrace/trace-handle.h | 8 ++++++++ 10 files changed, 78 insertions(+) diff --git a/include/babeltrace/clock-types.h b/include/babeltrace/clock-types.h index 438d335f..e1fbfb7d 100644 --- a/include/babeltrace/clock-types.h +++ b/include/babeltrace/clock-types.h @@ -22,6 +22,10 @@ * all copies or substantial portions of the Software. */ +#ifdef __cplusplus +extern "C" { +#endif + /* * The Babeltrace clock representations */ @@ -30,4 +34,8 @@ enum bt_clock_type { BT_CLOCK_REAL, }; +#ifdef __cplusplus +} +#endif + #endif /* _BABELTRACE_CLOCK_TYPES_H */ diff --git a/include/babeltrace/context.h b/include/babeltrace/context.h index ee2a724a..bc7de3a0 100644 --- a/include/babeltrace/context.h +++ b/include/babeltrace/context.h @@ -26,6 +26,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* struct bt_context is opaque to the user */ struct bt_context; struct stream_pos; @@ -105,4 +109,8 @@ void bt_context_put(struct bt_context *ctx); */ struct bt_context *bt_ctf_event_get_context(const struct bt_ctf_event *event); +#ifdef __cplusplus +} +#endif + #endif /* _BABELTRACE_CONTEXT_H */ diff --git a/include/babeltrace/ctf/callbacks.h b/include/babeltrace/ctf/callbacks.h index 597d4b17..128d597b 100644 --- a/include/babeltrace/ctf/callbacks.h +++ b/include/babeltrace/ctf/callbacks.h @@ -25,6 +25,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* Forward declarations */ struct bt_ctf_iter; struct bt_dependencies; @@ -97,4 +101,8 @@ enum { BT_FLAGS_FREE_PRIVATE_DATA = (1 << 0), }; +#ifdef __cplusplus +} +#endif + #endif /*_BABELTRACE_CTF_CALLBACKS_H */ diff --git a/include/babeltrace/ctf/events.h b/include/babeltrace/ctf/events.h index c34ae9a4..bbb9d9a5 100644 --- a/include/babeltrace/ctf/events.h +++ b/include/babeltrace/ctf/events.h @@ -27,6 +27,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + struct definition; struct bt_ctf_event; struct bt_ctf_event_decl; @@ -243,4 +247,8 @@ int bt_ctf_get_decl_fields(struct bt_ctf_event_decl *event_decl, */ const char *bt_ctf_get_decl_field_name(const struct bt_ctf_field_decl *field); +#ifdef __cplusplus +} +#endif + #endif /* _BABELTRACE_CTF_EVENTS_H */ diff --git a/include/babeltrace/ctf/iterator.h b/include/babeltrace/ctf/iterator.h index fe70b5e7..9370583a 100644 --- a/include/babeltrace/ctf/iterator.h +++ b/include/babeltrace/ctf/iterator.h @@ -25,6 +25,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + struct bt_ctf_iter; struct bt_ctf_event; @@ -70,4 +74,8 @@ void bt_ctf_iter_destroy(struct bt_ctf_iter *iter); */ struct bt_ctf_event *bt_ctf_iter_read_event(struct bt_ctf_iter *iter); +#ifdef __cplusplus +} +#endif + #endif /* _BABELTRACE_CTF_ITERATOR_H */ diff --git a/include/babeltrace/format.h b/include/babeltrace/format.h index 4ace0b04..ef340da1 100644 --- a/include/babeltrace/format.h +++ b/include/babeltrace/format.h @@ -26,6 +26,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + typedef int bt_intern_str; /* forward declaration */ @@ -75,5 +79,8 @@ extern void bt_fprintf_format_list(FILE *fp); extern int bt_register_format(struct format *format); /* TBD: format unregistration */ +#ifdef __cplusplus +} +#endif #endif /* _BABELTRACE_FORMAT_H */ diff --git a/include/babeltrace/iterator.h b/include/babeltrace/iterator.h index 22dabb47..3f7984fb 100644 --- a/include/babeltrace/iterator.h +++ b/include/babeltrace/iterator.h @@ -20,6 +20,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* Forward declarations */ struct bt_iter; struct bt_saved_pos; @@ -106,4 +110,8 @@ int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *pos); struct bt_iter_pos *bt_iter_create_time_pos(struct bt_iter *iter, uint64_t timestamp); +#ifdef __cplusplus +} +#endif + #endif /* _BABELTRACE_ITERATOR_H */ diff --git a/include/babeltrace/list.h b/include/babeltrace/list.h index 43a82167..ee5d84bd 100644 --- a/include/babeltrace/list.h +++ b/include/babeltrace/list.h @@ -25,6 +25,9 @@ found in the Linux kernel headers to enable people familiar with the latter find their way in these sources as well. */ +#ifdef __cplusplus +extern "C" { +#endif /* Basic type for the double-link list. */ struct bt_list_head @@ -168,4 +171,8 @@ static inline void bt_list_replace_init(struct bt_list_head *old, BT_INIT_LIST_HEAD(old); } +#ifdef __cplusplus +} +#endif + #endif /* _BT_LIST_H */ diff --git a/include/babeltrace/trace-collection.h b/include/babeltrace/trace-collection.h index bf68d4e6..0542d03c 100644 --- a/include/babeltrace/trace-collection.h +++ b/include/babeltrace/trace-collection.h @@ -21,6 +21,10 @@ * all copies or substantial portions of the Software. */ +#ifdef __cplusplus +extern "C" { +#endif + struct trace_collection; void init_trace_collection(struct trace_collection *tc); @@ -30,4 +34,8 @@ int trace_collection_add(struct trace_collection *tc, int trace_collection_remove(struct trace_collection *tc, struct trace_descriptor *td); +#ifdef __cplusplus +} +#endif + #endif /* _BABELTRACE_TRACE_COLLECTION_H */ diff --git a/include/babeltrace/trace-handle.h b/include/babeltrace/trace-handle.h index f0e23125..426800d8 100644 --- a/include/babeltrace/trace-handle.h +++ b/include/babeltrace/trace-handle.h @@ -25,6 +25,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* * trace_handle : unique identifier of a trace * @@ -63,4 +67,8 @@ uint64_t bt_trace_handle_get_timestamp_end(struct bt_context *ctx, */ int bt_ctf_event_get_handle_id(const struct bt_ctf_event *event); +#ifdef __cplusplus +} +#endif + #endif /* _BABELTRACE_TRACE_HANDLE_H */ -- 2.34.1