Remove extern "C" from internal headers
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 15 Oct 2021 19:55:28 +0000 (15:55 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 18 Nov 2021 00:17:31 +0000 (19:17 -0500)
All internal code is now compiled as C++, we can now remove all 'extern
"C"' declarations from internal headers.  This means files will see each
other's declarations as C++, and we can now use things in headers.

Remove the min/min_t/max/max_t macros from macros.h as well.

Change-Id: I5a6b7ef60be5f46160c6d5ca39f082d2137d5a07
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
82 files changed:
include/lttng/action/action-internal.h
include/lttng/action/list-internal.h
include/lttng/action/path-internal.h
include/lttng/action/rate-policy-internal.h
include/lttng/condition/buffer-usage-internal.h
include/lttng/condition/condition-internal.h
include/lttng/condition/event-rule-matches-internal.h
include/lttng/condition/session-consumed-size-internal.h
include/lttng/condition/session-rotation-internal.h
include/lttng/domain-internal.h
include/lttng/error-query-internal.h
include/lttng/event-expr-internal.h
include/lttng/event-internal.h
include/lttng/event-rule/event-rule-internal.h
include/lttng/event-rule/kernel-syscall-internal.h
include/lttng/health-internal.h
include/lttng/kernel-probe-internal.h
include/lttng/location-internal.h
include/lttng/log-level-rule-internal.h
include/lttng/notification/notification-internal.h
include/lttng/session-descriptor-internal.h
include/lttng/trigger/trigger-internal.h
include/lttng/userspace-probe-internal.h
src/bin/lttng-sessiond/condition-internal.h
src/bin/lttng-sessiond/ust-ctl-internal.h
src/bin/lttng/loglevel.h
src/common/buffer-view.h
src/common/bytecode/bytecode.h
src/common/compat/directory-handle.h
src/common/compat/fcntl.h
src/common/compat/poll.h
src/common/config/ini.h
src/common/config/session-config.h
src/common/consumer/consumer-metadata-cache.h
src/common/consumer/consumer-stream.h
src/common/consumer/consumer-timer.h
src/common/consumer/consumer.h
src/common/consumer/metadata-bucket.h
src/common/context.h
src/common/credentials.h
src/common/daemonize.h
src/common/defaults.h
src/common/dynamic-array.h
src/common/dynamic-buffer.h
src/common/error.h
src/common/fd-handle.h
src/common/fd-tracker/fd-tracker.h
src/common/fd-tracker/utils.h
src/common/filter.h
src/common/filter/filter-ast.h
src/common/fs-handle.h
src/common/futex.h
src/common/hashtable/hashtable.h
src/common/hashtable/utils.h
src/common/index-allocator.h
src/common/index/index.h
src/common/kernel-consumer/kernel-consumer.h
src/common/kernel-ctl/kernel-ctl.h
src/common/macros.h
src/common/mi-lttng.h
src/common/payload-view.h
src/common/payload.h
src/common/pipe.h
src/common/readwrite.h
src/common/relayd/relayd.h
src/common/runas.h
src/common/sessiond-comm/inet.h
src/common/sessiond-comm/sessiond-comm.h
src/common/shm.h
src/common/spawn-viewer.h
src/common/string-utils/string-utils.h
src/common/testpoint/testpoint.h
src/common/time.h
src/common/trace-chunk-registry.h
src/common/trace-chunk.h
src/common/tracker.h
src/common/unix.h
src/common/uri.h
src/common/ust-consumer/ust-consumer.h
src/common/utils.h
src/common/uuid.h
src/common/waiter.h

index b55a6d59bc2dcde627f517b51436c163afe3d911..71270a835cfd95a9d2d93141ef1d0d6c4542c66e 100644 (file)
 #include <sys/types.h>
 #include <urcu/ref.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_rate_policy;
 struct mi_writer;
 struct mi_lttng_error_query_callbacks;
@@ -132,8 +128,4 @@ enum lttng_error_code lttng_action_mi_serialize(const struct lttng_trigger *trig
                                *error_query_callbacks,
                struct lttng_dynamic_array *action_path_indexes);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_ACTION_INTERNAL_H */
index 3d7a5ba60f03d9b604a726347a1500259f0b166d..231755fd6795b55d88eb2562115526aabb97ab51 100644 (file)
 
 #include <common/macros.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_action;
 struct lttng_payload_view;
 struct mi_writer;
@@ -43,8 +39,4 @@ enum lttng_error_code lttng_action_list_mi_serialize(const struct lttng_trigger
                                *error_query_callbacks,
                struct lttng_dynamic_array *action_path_indexes);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_ACTION_LIST_INTERNAL_H */
index 361c348fe1b696c6f93c73d7d7c2d0b64508974c..8a255f0b705fb4dd7d14111d37f61dc8a48d5413 100644 (file)
 #include <common/payload.h>
 #include <sys/types.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_action_path {
        struct lttng_dynamic_array indexes;
 };
@@ -34,8 +30,4 @@ ssize_t lttng_action_path_create_from_payload(
 int lttng_action_path_serialize(const struct lttng_action_path *action_path,
                struct lttng_payload *payload);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_ACTION_PATH_INTERNAL_H */
index 708892cba86b11134cd97f07dcc7167208d690df..b24ed52385223c775f63705afe06b402e4090613 100644 (file)
 #include <stdbool.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct mi_writer;
 
 int lttng_rate_policy_serialize(struct lttng_rate_policy *rate_policy,
@@ -43,8 +39,4 @@ enum lttng_error_code lttng_rate_policy_mi_serialize(
                const struct lttng_rate_policy *policy,
                struct mi_writer *writer);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_RATE_POLICY */
index 6ea19e065f7e3fec613e60f4ce7f38fd1ebfdedb..1e6d5a509c40b8c518dc90e634c0cc76322dd0bc 100644 (file)
 #include "common/buffer-view.h"
 #include <common/macros.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_condition_buffer_usage {
        struct lttng_condition parent;
        struct {
@@ -81,8 +77,4 @@ ssize_t lttng_evaluation_buffer_usage_high_create_from_payload(
                struct lttng_payload_view *view,
                struct lttng_evaluation **evaluation);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H */
index a491d3fe34a46e33bf02f6d4a5c585724a17c89f..5bafaf05b266e00fee1b1ee03e8b58268244a77b 100644 (file)
 #include <urcu/list.h>
 #include <urcu/ref.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 struct mi_writer;
 struct mi_lttng_error_query_callbacks;
 struct lttng_trigger;
@@ -86,8 +82,4 @@ enum lttng_error_code lttng_condition_mi_serialize(
 
 const char *lttng_condition_type_str(enum lttng_condition_type type);
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* LTTNG_CONDITION_INTERNAL_H */
index 4aac9f991e3517df7eac0395ce77dd19c2e63108..ef39f4f04f86b2a57d2e15a75c5609cc796495d8 100644 (file)
 #include <common/dynamic-array.h>
 #include <lttng/event-field-value.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_capture_descriptor {
        struct lttng_event_expr *event_expression;
        struct lttng_bytecode *bytecode;
@@ -90,8 +86,4 @@ const struct lttng_bytecode *
 lttng_condition_event_rule_matches_get_capture_bytecode_at_index(
                const struct lttng_condition *condition, unsigned int index);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_CONDITION_EVENT_RULE_MATCHES_INTERNAL_H */
index 07c5953e1d014965bd933ba6bbd821b918b095c8..9340a5f233f6cb5566b0defac1edc57c2878cb70 100644 (file)
 #include <common/buffer-view.h>
 #include <common/macros.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_payload;
 struct lttng_payload_view;
 
@@ -57,8 +53,4 @@ ssize_t lttng_evaluation_session_consumed_size_create_from_payload(
                struct lttng_payload_view *view,
                struct lttng_evaluation **evaluation);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_CONDITION_SESSION_CONSUMED_SIZE_INTERNAL_H */
index e5993e9609b44f7a27712dcc1d0cc862c11d9077..c723c6d6a74638ac22452b5db71204ddc8574b15 100644 (file)
 #include <lttng/location.h>
 #include <common/macros.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_condition_session_rotation {
        struct lttng_condition parent;
        char *session_name;
@@ -65,8 +61,4 @@ ssize_t lttng_evaluation_session_rotation_completed_create_from_payload(
                struct lttng_payload_view *view,
                struct lttng_evaluation **evaluation);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_CONDITION_SESSION_ROTATION_INTERNAL_H */
index 13d4a6bc13dcdd862af04295bc7da406b338a27a..c34ba19306a9863b7888540faefe11d19e1ecc40 100644 (file)
 #include "lttng/domain.h"
 #include "common/macros.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 const char *lttng_domain_type_str(enum lttng_domain_type domain_type);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_DOMAIN_INTERNAL_H */
index d3072f54b378a7ae862cccb0e4b15dcb449e4bd9..07e2280d7486a283ebab703435f61a03cfd5338f 100644 (file)
 #include <common/payload.h>
 #include <common/payload-view.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct mi_writer;
 
 enum lttng_error_query_target_type {
@@ -82,8 +78,4 @@ enum lttng_error_code lttng_error_query_results_mi_serialize(
                const struct lttng_error_query_results *results,
                struct mi_writer *writer);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_ERROR_QUERY_INTERNAL_H */
index d40f2fa017f272ec12961e49cda9e59d69a7dd2d..469fd17bbf32f685ff05f42760aae07eaaf6c82c 100644 (file)
 #include <common/macros.h>
 #include <lttng/event-expr.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_bytecode;
 struct mi_writer;
 
@@ -68,8 +64,4 @@ enum lttng_error_code lttng_event_expr_mi_serialize(
                const struct lttng_event_expr *expression,
                struct mi_writer *writer);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_EVENT_EXPR_INTERNAL_H */
index 7370d0510730eb77d4f039bd62c828c911c5c47c..8d03fbdec5680c10fd861b02dfe92bac8e5fd379 100644 (file)
 #include <common/macros.h>
 #include <lttng/event.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_userspace_probe_location;
 
 struct lttng_event_extended {
@@ -39,8 +35,4 @@ struct lttng_event_extended {
 
 struct lttng_event *lttng_event_copy(const struct lttng_event *event);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_EVENT_INTERNAL_H */
index 98d1f449d2e9000d6d781a6802275d8e74af45e7..8026748634fd0f9efa80121ee74c0d2499865ff5 100644 (file)
 #include <sys/types.h>
 #include <urcu/ref.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 struct lttng_payload;
 struct lttng_payload_view;
 struct mi_writer;
@@ -157,8 +153,4 @@ bool lttng_event_rule_targets_agent_domain(const struct lttng_event_rule *rule);
 enum lttng_error_code lttng_event_rule_mi_serialize(
                const struct lttng_event_rule *rule, struct mi_writer *writer);
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* LTTNG_EVENT_RULE_INTERNAL_H */
index 3e5e0991d64cf498b3f77afb53bf4b6466b29a4d..30123815332a606ec0081f7e09aa77bb21917fb7 100644 (file)
 #include <lttng/event-rule/event-rule-internal.h>
 #include <lttng/event-rule/kernel-syscall.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 struct lttng_event_rule_kernel_syscall {
        struct lttng_event_rule parent;
        enum lttng_event_rule_kernel_syscall_emission_site emission_site;
@@ -51,8 +47,4 @@ ssize_t lttng_event_rule_kernel_syscall_create_from_payload(
 const char *lttng_event_rule_kernel_syscall_emission_site_str(
                enum lttng_event_rule_kernel_syscall_emission_site emission_site);
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* LTTNG_EVENT_RULE_KERNEL_SYSCALL_INTERNAL_H */
index 875cc960b329a015de2af81962a4c4a6fba2563a..ceda0a8dd5b027321c514885ea6d4124e717b710 100644 (file)
 #include <lttng/health.h>
 #include <common/macros.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * These are the value added to the current state depending of the position in
  * the thread where is either waiting on a poll() or running in the code.
@@ -120,8 +116,4 @@ int health_check_state(struct health_app *ha, int type);
 void health_register(struct health_app *ha, int type);
 void health_unregister(struct health_app *ha);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* HEALTH_INTERNAL_H */
index 87d0ab9aad0cd70be0bb8b2b756367cbd5a48284..2d2ab86844472a836aa474adaa3650857be9d2c7 100644 (file)
 #include <stdint.h>
 #include <sys/types.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_payload;
 struct lttng_payload_view;
 struct lttng_dynamic_buffer;
@@ -112,8 +108,4 @@ enum lttng_error_code lttng_kernel_probe_location_mi_serialize(
                const struct lttng_kernel_probe_location *location,
                struct mi_writer *writer);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_KERNEL_PROBE_INTERNAL_H */
index 9eafd471a2d5273cb4aa2273cfc304ce8f9f0b02..33498c90d5c0482b6663fdff5cb6ea68f547aa12 100644 (file)
 #include <sys/types.h>
 #include <urcu/ref.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * The public API assumes that trace archive locations are always
  * provided as "constant". This means that the user of liblttng-ctl never
@@ -101,8 +97,4 @@ void lttng_trace_archive_location_get(
 void lttng_trace_archive_location_put(
                struct lttng_trace_archive_location *location);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_LOCATION_INTERNAL_H */
index 26abaa862e317759772dfd88cc5a3157afd3f77b..ac0f74b71fff30ac7b743ad7f3197b08140d3e3a 100644 (file)
 #include <lttng/log-level-rule.h>
 #include <lttng/lttng-error.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct mi_writer;
 
 /*
@@ -65,8 +61,4 @@ enum lttng_error_code lttng_log_level_rule_mi_serialize(
                const struct lttng_log_level_rule *rule,
                struct mi_writer *writer);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_LOG_LEVEL_RULE_INTERNAL_H */
index 1d337e07db6b18e62f2ab2bd58a89c3f40a351af..7e601b0c7de82d5340b8686c932bff42e6b5b63d 100644 (file)
 #include <stdbool.h>
 #include <sys/types.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_payload;
 struct lttng_payload_view;
 
@@ -44,8 +40,4 @@ ssize_t lttng_notification_create_from_payload(
                struct lttng_payload_view *view,
                struct lttng_notification **notification);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_NOTIFICATION_INTERNAL_H */
index 97628bb881c4c2f2a21491f81216323af7006108..f438d4812ff66a643d365626a383d2eae40eb789 100644 (file)
 #include <common/buffer-view.h>
 #include <stdbool.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* Note that these enums are used as part of the lttnctl protocol. */
 enum lttng_session_descriptor_type {
        LTTNG_SESSION_DESCRIPTOR_TYPE_UNKNOWN = -1,
@@ -85,8 +81,4 @@ int lttng_session_descriptor_assign(
                struct lttng_session_descriptor *dst_descriptor,
                const struct lttng_session_descriptor *src_descriptor);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_SESSION_DESCRIPTOR_INTERNAL_H */
index 69226bce75b3a5f45dfba06584e8192ff8195ef5..dab46ae075dfa61fcea30168e9d74784281c01a8 100644 (file)
 #include <sys/types.h>
 #include <urcu/ref.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 struct lttng_payload;
 struct lttng_payload_view;
 struct mi_writer;
@@ -282,8 +278,4 @@ enum lttng_trigger_status lttng_trigger_add_action_error_query_results(
 enum lttng_trigger_status lttng_trigger_set_name(
                struct lttng_trigger *trigger, const char *name);
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* LTTNG_TRIGGER_INTERNAL_H */
index fe96a4ea3b2b926fac04b232d562f68c6b641e6f..5e960c106db1b853224d12c4da59f8c6f1695e18 100644 (file)
 #include <common/fd-handle.h>
 #include <stdbool.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_payload;
 struct lttng_payload_view;
 struct lttng_dynamic_buffer;
@@ -163,8 +159,4 @@ enum lttng_error_code lttng_userspace_probe_location_mi_serialize(
                const struct lttng_userspace_probe_location *location,
                struct mi_writer *writer);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_USERSPACE_PROBE_INTERNAL_H */
index fa8f7be044ef011062a964743d52d1eb5dbc64e5..49a074952a5bed638661adcf6e8e579aee500b91 100644 (file)
 
 #include <lttng/condition/condition.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * The lttng_condition hashing code is kept in this file (rather than
  * condition.c) since it makes use of GPLv2 code (hashtable utils), which we
@@ -24,8 +20,4 @@ unsigned long lttng_condition_hash(const struct lttng_condition *condition);
 struct lttng_condition *lttng_condition_copy(
                const struct lttng_condition *condition);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_SESSIOND_CONDITION_INTERNAL_H */
index d85af28684d6dc034cc93d11cf362a0a0aa9cbcc..610aa7f363ba208efdfe0c7321d105a9722c0097 100644 (file)
 
 #include "lttng-ust-abi.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #ifndef LTTNG_UST_UUID_LEN
 #define LTTNG_UST_UUID_LEN     16
 #endif
@@ -659,8 +655,4 @@ int lttng_ust_ctl_counter_clear(struct lttng_ust_ctl_daemon_counter *counter,
 
 void lttng_ust_ctl_sigbus_handle(void *addr);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_UST_CTL_INTERNAL_H */
index 06dcbaa8647e03de2d46deda97c34e57ebbcdf87..43ae8e44858cdadd13308a630d7fe2846b5b928b 100644 (file)
 #include <lttng/lttng.h>
 #include <common/macros.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 int loglevel_name_to_value(const char *name, enum lttng_loglevel *loglevel);
 
 bool loglevel_parse_range_string(const char *str,
@@ -50,8 +46,4 @@ const char *loglevel_jul_value_to_name(int loglevel);
 
 const char *loglevel_python_value_to_name(int loglevel);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _LTTNG_LOGLEVEL_UTILS_H */
index ecd764d7c019f1c5e5902b848676f78df93ef223..58f1ede2e94c34f9d745a65d2e94014645a19ea8 100644 (file)
 #include <stddef.h>
 #include <stdint.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_dynamic_buffer;
 
 struct lttng_buffer_view {
@@ -96,8 +92,4 @@ bool lttng_buffer_view_contains_string(const struct lttng_buffer_view *buf,
                const char *str,
                size_t len_with_null_terminator);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_BUFFER_VIEW_H */
index 54ed7363ec493b6c0c2b14db940d2402edf6ccf4..386f58241713147de80106ccebf63ebb476224a9 100644 (file)
 #include "common/macros.h"
 #include "common/sessiond-comm/sessiond-comm.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * offsets are absolute from start of bytecode.
  */
@@ -262,8 +258,4 @@ unsigned int bytecode_get_len(struct lttng_bytecode *bytecode)
        return bytecode->len;
 }
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_COMMON_BYTECODE_H */
index 9a107201987f129ee4bd7dbdd12a359893fffebd..6aa5c3d3e3691b65fedc52b48ed8aae74d879b28 100644 (file)
 #include <sys/stat.h>
 #include <urcu/ref.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 enum lttng_directory_handle_rmdir_recursive_flags {
        LTTNG_DIRECTORY_HANDLE_FAIL_NON_EMPTY_FLAG = (1U << 0),
        LTTNG_DIRECTORY_HANDLE_SKIP_NON_EMPTY_FLAG = (1U << 1),
@@ -264,8 +260,4 @@ bool lttng_directory_handle_equals(const struct lttng_directory_handle *lhs,
                const struct lttng_directory_handle *rhs);
 
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _COMPAT_PATH_HANDLE_H */
index 8bbdfe89cc75c122bda2ea7b77db27ca0727ebf6..b18e2f4e76d653b2810e1bd8892edbd9031d1b90 100644 (file)
 
 #include <common/compat/errno.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #if (defined(__CYGWIN__))
 typedef long long off64_t;
 #endif
@@ -68,8 +64,4 @@ static inline ssize_t splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_
 #error "Please add support for your OS."
 #endif /* __linux__ , __FreeBSD__, __CYGWIN__, __sun__, __APPLE__ */
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _COMPAT_FCNTL_H */
index 75de9ba5fcf0a3ea60cbc086c9c60df3d680f0be..e2a424abe132d564769d69de28aba40b50512324 100644 (file)
 
 #include <common/common.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * Used by lttng_poll_clean to free the events structure in a lttng_poll_event.
  */
@@ -25,10 +21,6 @@ static inline void __lttng_poll_free(void *events)
        free(events);
 }
 
-#ifdef __cplusplus
-}
-#endif
-
 /*
  * epoll(7) implementation.
  */
@@ -38,10 +30,6 @@ static inline void __lttng_poll_free(void *events)
 #include <features.h>
 #include <common/compat/fcntl.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* See man epoll(7) for this define path */
 #define COMPAT_EPOLL_PROC_PATH "/proc/sys/fs/epoll/max_user_watches"
 
@@ -220,10 +208,6 @@ static inline void lttng_poll_clean(struct lttng_poll_event *events)
        __lttng_poll_free((void *) events->events);
 }
 
-#ifdef __cplusplus
-}
-#endif
-
 #else  /* HAVE_EPOLL */
 /*
  * Fallback on poll(2) API
@@ -242,10 +226,6 @@ static inline void lttng_poll_clean(struct lttng_poll_event *events)
 #include <poll.h>
 #include <stdint.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 enum {
        /* Polling variables compatibility for poll */
        LPOLLIN = POLLIN,
@@ -397,10 +377,6 @@ static inline void lttng_poll_clean(struct lttng_poll_event *events)
        }
 }
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* HAVE_EPOLL */
 
 #endif /* _LTT_POLL_H */
index 4522bd74ec54c54d0716ad53be03346f40779bb8..34b3654eae7b78e933aa1e3bc20287fca193f072 100644 (file)
 #define __INI_H__
 
 /* Make this header file easier to include in C++ code */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include <stdio.h>
 
 typedef int (*ini_entry_handler)(void *, const char *, const char *,
@@ -95,8 +91,4 @@ int ini_parse_file(FILE *file, ini_entry_handler handler, void *user);
 #define INI_MAX_LINE 200
 #endif
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* __INI_H__ */
index ff74eb0992bfd8c7e76729d15602c5e0dcd604b2..a6955b0b95b4e9435114187c6ebeb1adfd8093fd 100644 (file)
 #include <common/macros.h>
 #include <stdint.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct config_entry {
        /* section is NULL if the entry is not in a section */
        const char *section;
@@ -233,8 +229,4 @@ int config_load_session(const char *path, const char *session_name,
                int overwrite, unsigned int autoload,
                const struct config_load_session_override_attr *overrides);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _CONFIG_H */
index 4f8bb763fefdd1a893c01f5bd70f1fa9148866df..b8f4efadc4c5ec59913cb75ea1644882fab2331b 100644 (file)
 #include <common/consumer/consumer.h>
 #include <common/dynamic-buffer.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 enum consumer_metadata_cache_write_status {
        CONSUMER_METADATA_CACHE_WRITE_STATUS_ERROR = -1,
        /*
@@ -63,8 +59,4 @@ void consumer_metadata_cache_destroy(struct lttng_consumer_channel *channel);
 int consumer_metadata_cache_flushed(struct lttng_consumer_channel *channel,
                uint64_t offset, int timer);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* CONSUMER_METADATA_CACHE_H */
index af0690a25a0920e3e4c9cb4638c38724aa94b351..c9af63cd83841c10a542e015aba3d6c3eb5fd69d 100644 (file)
 
 #include "consumer.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 enum consumer_stream_open_packet_status {
        CONSUMER_STREAM_OPEN_PACKET_STATUS_OPENED,
        CONSUMER_STREAM_OPEN_PACKET_STATUS_NO_SPACE,
@@ -170,8 +166,4 @@ enum consumer_stream_open_packet_status consumer_stream_open_packet(
 int consumer_stream_flush_buffer(struct lttng_consumer_stream *stream,
                bool producer_active);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_CONSUMER_STREAM_H */
index 084eb017d522e4d94f6fdf4967cb5481eb2627ef..85751442f7751eb0b2467c292290004f1fe87216 100644 (file)
 
 #include "consumer.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #define LTTNG_CONSUMER_SIG_SWITCH      SIGRTMIN + 10
 #define LTTNG_CONSUMER_SIG_TEARDOWN    SIGRTMIN + 11
 #define LTTNG_CONSUMER_SIG_LIVE                SIGRTMIN + 12
@@ -57,8 +53,4 @@ int consumer_flush_ust_index(struct lttng_consumer_stream *stream);
 int consumer_timer_thread_get_channel_monitor_pipe(void);
 int consumer_timer_thread_set_channel_monitor_pipe(int fd);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* CONSUMER_TIMER_H */
index 582385c82bef2454361f39b6dca0d70b294157d7..7f8d14704d23ec6a8ad967ecc951f09d6d017ced 100644 (file)
 #include <common/buffer-view.h>
 #include <common/dynamic-array.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_consumer_local_data;
 
 /* Commands for consumer */
@@ -1069,8 +1065,4 @@ enum lttcomm_return_code lttng_consumer_open_channel_packets(
 int consumer_metadata_wakeup_pipe(const struct lttng_consumer_channel *channel);
 void lttng_consumer_sigbus_handle(void *addr);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LIB_CONSUMER_H */
index 8868811efb2ed721793e3fa6472e01216b45b0eb..993d3f483f387fdf82e59133d6a89d37aeaf1c9c 100644 (file)
 
 #include <common/consumer/consumer.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct metadata_bucket;
 
 typedef ssize_t (*metadata_bucket_flush_cb)(
@@ -34,8 +30,4 @@ enum metadata_bucket_status metadata_bucket_fill(struct metadata_bucket *bucket,
 
 void metadata_bucket_reset(struct metadata_bucket *bucket);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* METADATA_BUCKET_H */
index b6755addacb4453325aa2b122587677fe9d40638..f4abd841726d41b1ad48fcf52d8eea9ec6b6d1f9 100644 (file)
 
 #include <common/macros.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * Parse string as an application context of the form
  * "$app.provider_name:context_name" and return the provider name and context
@@ -28,8 +24,4 @@ extern "C" {
 int parse_application_context(const char *str, char **provider_name,
                char **ctx_name);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_COMMON_CONTEXT_H */
index 21aa33416f50bacb38aae862a3a28ceab3839307..b1576a75795a5bd924f13fd7003e224808b7591b 100644 (file)
 
 #include "optional.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_credentials {
        LTTNG_OPTIONAL(uid_t) uid;
        LTTNG_OPTIONAL(gid_t) gid;
@@ -36,8 +32,4 @@ bool lttng_credentials_is_equal_gid(const struct lttng_credentials *a,
 bool lttng_credentials_is_equal(const struct lttng_credentials *a,
                const struct lttng_credentials *b);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_CREDENTIALS_H */
index 8590779c27c3b62d1f2e5e3dced53a57914b4666..2c88f06b7ddaa1dd1ac9224997e220e0dda8f3cb 100644 (file)
 #include <unistd.h>
 #include <common/macros.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * Daemonize this process by forking and making the parent wait for the child
  * to signal it indicating readiness. Once received, the parent successfully
@@ -29,8 +25,4 @@ extern "C" {
 int lttng_daemonize(pid_t *child_ppid, int *completion_flag,
                int close_fds);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_DAEMONIZE_H */
index 95b1dc29ba16fa5c87df7d00f798eec68ccc1a85..39b77470d68a4aa294858205cc7b365349f055c7 100644 (file)
 #include <pthread.h>
 #include <common/macros.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* Default unix group name for tracing. */
 #define DEFAULT_TRACING_GROUP                   "tracing"
 
@@ -428,8 +424,4 @@ size_t default_get_ust_uid_channel_subbuf_size(void);
  */
 pthread_attr_t *default_pthread_attr(void);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _DEFAULTS_H */
index a370774049bd680df09ccc2716b0ba38e401be8b..8b08186dd2b8897b1b0ed744abfb5ee8420809ff 100644 (file)
 
 #include <common/dynamic-buffer.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 typedef void (*lttng_dynamic_array_element_destructor)(void *element);
 typedef void (*lttng_dynamic_pointer_array_destructor)(void *ptr);
 
@@ -181,8 +177,4 @@ void lttng_dynamic_pointer_array_reset(
 void lttng_dynamic_pointer_array_clear(
                struct lttng_dynamic_pointer_array *array);
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* LTTNG_DYNAMIC_ARRAY_H */
index d4813fa3919b6c3d43dc536d308368f8f186b837..0e0dedc9b01b9af35b10e3c74a5f21e9afc557c7 100644 (file)
 #include <stdint.h>
 #include <common/macros.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_buffer_view;
 
 struct lttng_dynamic_buffer {
@@ -96,8 +92,4 @@ void lttng_dynamic_buffer_reset(struct lttng_dynamic_buffer *buffer);
 size_t lttng_dynamic_buffer_get_capacity_left(
                struct lttng_dynamic_buffer *buffer);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_DYNAMIC_BUFFER_H */
index 8bb0de15cfa70f0c621bae207932274903a65c70..a061f6680e12e33b41f9db79053a3e4be874c458 100644 (file)
 #include <lttng/lttng-error.h>
 #include <common/compat/tid.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 /* Avoid conflict with Solaris <sys/regset.h> */
 #if defined(ERR) && defined(__sun__)
 #undef ERR
@@ -268,8 +264,4 @@ const char *log_add_time(void);
 /* Name must be a statically-allocated string. */
 void logger_set_thread_name(const char *name, bool set_pthread_name);
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* _ERROR_H */
index 36a92473a0b6ec7c2c1162e779448f0885d3d4d7..dab9e2bfaccab4017502f079aba83f5b2fe27e04 100644 (file)
 
 #include <common/macros.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * Wrapper around a file descriptor providing reference counting semantics.
  *
@@ -48,8 +44,4 @@ int fd_handle_get_fd(struct fd_handle *handle);
  */
 struct fd_handle *fd_handle_copy(const struct fd_handle *handle);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* FS_HANDLE_H */
index 5801622e22995610b4e5083d5623163f095ebe44..5c9810749371071000437c9e49b5e2d2f33df5f3 100644 (file)
 #include <stdint.h>
 #include <sys/types.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct fs_handle;
 struct fd_tracker;
 
@@ -142,8 +138,4 @@ int fd_tracker_close_unsuspendable_fd(struct fd_tracker *tracker,
  */
 void fd_tracker_log(struct fd_tracker *tracker);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* FD_TRACKER_H */
index ac614c7b17fc50f483b75b32a24cd48054a1f45c..829b56b6d2ab5f82efb3e634de0108293b10db31 100644 (file)
 #include <common/fd-tracker/fd-tracker.h>
 #include <common/macros.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_poll_event;
 
 /*
@@ -50,8 +46,4 @@ struct lttng_directory_handle *fd_tracker_create_directory_handle_from_handle(
                struct lttng_directory_handle *handle,
                const char *path);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* FD_TRACKER_UTILS_H */
index f5dcdf319f8f6fdfd26a82210e9d8e7c0da46105..305434bf6e0d1a5de3e626d6e6ed114ec403ac69 100644 (file)
 
 #include <common/sessiond-comm/sessiond-comm.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct bytecode_symbol_iterator;
 
 /*
@@ -37,8 +33,4 @@ const char *bytecode_symbol_iterator_get_name(
 
 void bytecode_symbol_iterator_destroy(struct bytecode_symbol_iterator *it);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_COMMON_FILTER_H */
index 5033b46ea403a2817b794d3d56ebf3460fb062f9..2b460b401ef669d87a3ab9da67e973a564914e59 100644 (file)
 #include <stdio.h>
 #include <stdint.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 #define printf_debug(fmt, args...)                                     \
        do {                                                            \
                if (filter_parser_debug)                                \
@@ -194,8 +190,4 @@ int filter_visitor_ir_validate_string(struct filter_parser_ctx *ctx);
 int filter_visitor_ir_normalize_glob_patterns(struct filter_parser_ctx *ctx);
 int filter_visitor_ir_validate_globbing(struct filter_parser_ctx *ctx);
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* _FILTER_AST_H */
index afc5abc48571ed1510e91b56ba13d9d7151a8819..be6419c88315343b2980b415a54fc84ca0ae475e 100644 (file)
 #include <common/macros.h>
 #include <stdio.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct fs_handle;
 
 /*
@@ -67,8 +63,4 @@ int fs_handle_truncate(struct fs_handle *handle, off_t offset);
 
 off_t fs_handle_seek(struct fs_handle *handle, off_t offset, int whence);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* FS_HANDLE_H */
index 92a8446746265daf53066e6bde370deea699a262..602be318647fe751b86bc9b2205e3bb79b4255f3 100644 (file)
@@ -9,17 +9,9 @@
 #ifndef _LTT_FUTEX_H
 #define _LTT_FUTEX_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 void futex_wait_update(int32_t *futex, int active);
 void futex_nto1_prepare(int32_t *futex);
 void futex_nto1_wait(int32_t *futex);
 void futex_nto1_wake(int32_t *futex);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _LTT_FUTEX_H */
index e150190417b7a594db359fada7237c2871039390..3a515fdbde030e2639d67a8caaf90dda9bb453d5 100644 (file)
 #include <lttng/lttng-export.h>
 #include <urcu/rculfhash.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 LTTNG_EXPORT extern unsigned long lttng_ht_seed;
 
 typedef unsigned long (*hash_fct_type)(const void *_key, unsigned long seed);
@@ -127,8 +123,4 @@ struct lttng_ht_node_u64 *lttng_ht_iter_get_node_u64(
 struct lttng_ht_node_two_u64 *lttng_ht_iter_get_node_two_u64(
                struct lttng_ht_iter *iter);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _LTT_HT_H */
index 44f80ce4fb2b65a585f59626d3ba20e470208d3c..992643931f5e42568fa2bd06dd6f16bb260c072a 100644 (file)
 
 #include <stdint.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 unsigned long hash_key_ulong(const void *_key, unsigned long seed);
 unsigned long hash_key_u64(const void *_key, unsigned long seed);
 unsigned long hash_key_str(const void *key, unsigned long seed);
@@ -23,8 +19,4 @@ int hash_match_key_u64(const void *key1, const void *key2);
 int hash_match_key_str(const void *key1, const void *key2);
 int hash_match_key_two_u64(const void *key1, const void *key2);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _LTT_HT_UTILS_H */
index 93ab5ddd5e1483cd268e1129d5565c5d70cdb1e6..ee7c2ec758dd5dd707780b9a42ae5d3c0d4fab6c 100644 (file)
 #include <inttypes.h>
 #include <lttng/lttng-export.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_index_allocator;
 
 enum lttng_index_allocator_status {
@@ -26,19 +22,22 @@ enum lttng_index_allocator_status {
 /*
  * Create an index allocator of `index_count` slots.
  */
-LTTNG_EXPORT struct lttng_index_allocator *lttng_index_allocator_create(
+extern "C" LTTNG_EXPORT
+struct lttng_index_allocator *lttng_index_allocator_create(
                uint64_t index_count);
 
 /*
  * Get the number of indexes currently in use.
  */
-LTTNG_EXPORT uint64_t lttng_index_allocator_get_index_count(
+extern "C" LTTNG_EXPORT
+uint64_t lttng_index_allocator_get_index_count(
        struct lttng_index_allocator *allocator);
 
 /*
  * Allocate (i.e. reserve) a slot.
  */
-LTTNG_EXPORT enum lttng_index_allocator_status lttng_index_allocator_alloc(
+extern "C" LTTNG_EXPORT
+enum lttng_index_allocator_status lttng_index_allocator_alloc(
                struct lttng_index_allocator *allocator,
                uint64_t *index);
 
@@ -46,16 +45,14 @@ LTTNG_EXPORT enum lttng_index_allocator_status lttng_index_allocator_alloc(
  * Release a slot by index. The slot will be re-used by the index allocator
  * in future 'alloc' calls.
  */
-LTTNG_EXPORT enum lttng_index_allocator_status lttng_index_allocator_release(
+extern "C" LTTNG_EXPORT
+enum lttng_index_allocator_status lttng_index_allocator_release(
                struct lttng_index_allocator *allocator, uint64_t index);
 
 /*
  * Destroy an index allocator.
  */
-LTTNG_EXPORT void lttng_index_allocator_destroy(struct lttng_index_allocator *allocator);
-
-#ifdef __cplusplus
-}
-#endif
+extern "C" LTTNG_EXPORT
+void lttng_index_allocator_destroy(struct lttng_index_allocator *allocator);
 
 #endif /* _COMMON_INDEX_ALLOCATOR_H */
index c7bc656823b9138fbd15827c273a8cec82e2a3bd..25ecc1975d2c38701ea7f50f0ab8fd896fae05d5 100644 (file)
 #include <common/fs-handle.h>
 #include <common/trace-chunk.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_index_file {
        struct fs_handle *file;
        uint32_t major;
@@ -56,8 +52,4 @@ int lttng_index_file_read(const struct lttng_index_file *index_file,
 void lttng_index_file_get(struct lttng_index_file *index_file);
 void lttng_index_file_put(struct lttng_index_file *index_file);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _INDEX_H */
index 71a33b73f42316799623bd70cdec35eabff73f06..004becb0f0feea1f93694d8ab21bc7a778322b25 100644 (file)
 #include <stdbool.h>
 #include <common/consumer/consumer.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 int lttng_kconsumer_take_snapshot(struct lttng_consumer_stream *stream);
 int lttng_kconsumer_sample_snapshot_positions(
                struct lttng_consumer_stream *stream);
@@ -31,8 +27,4 @@ int lttng_kconsumer_data_pending(struct lttng_consumer_stream *stream);
 enum sync_metadata_status lttng_kconsumer_sync_metadata(
                struct lttng_consumer_stream *metadata);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _LTTNG_KCONSUMER_H */
index c2fa6408bd53c4bfa623e2ad97f20ed66284f32f..e6805a983b706e4a31a414ab704fd65133fa59f0 100644 (file)
 #include <common/lttng-kernel-old.h>
 #include <common/sessiond-comm/sessiond-comm.h>        /* for struct lttng_filter_bytecode */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 int kernctl_create_session(int fd);
 int kernctl_open_metadata(int fd, struct lttng_channel_attr *chops);
 int kernctl_create_channel(int fd, struct lttng_channel_attr *chops);
@@ -129,8 +125,4 @@ int kernctl_get_current_timestamp(int fd, uint64_t *ts);
 int kernctl_get_sequence_number(int fd, uint64_t *seq);
 int kernctl_get_instance_id(int fd, uint64_t *seq);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _LTTNG_KERNEL_CTL_H */
index 7530c912a98251160b608e0bc0b4bf4daefff42e..74f9096c7cf3b83fded3864bc76d0b0d1e0c5fb0 100644 (file)
@@ -57,32 +57,6 @@ void *zmalloc(size_t len)
        })
 #endif
 
-
-/*
- * The min and max macros are not needed in C++ (std::min and std::max are
- * preferred) and they conflict with some C++ header file. Don't define them
- * when compiling C++ source.
- */
-#ifndef __cplusplus
-
-# ifndef max
-#  define max(a, b) ((a) > (b) ? (a) : (b))
-# endif
-
-# ifndef min
-#  define min(a, b) ((a) < (b) ? (a) : (b))
-# endif
-
-# ifndef max_t
-#  define max_t(type, a, b)    max((type) a, (type) b)
-# endif
-
-# ifndef min_t
-#  define min_t(type, a, b)    min((type) a, (type) b)
-# endif
-
-#endif
-
 #ifndef LTTNG_PACKED
 #define LTTNG_PACKED __attribute__((__packed__))
 #endif
index 74ae502f5be023941a939f7a3a0fe8571f72246a..a9c59a62ac61b6b33b11c65df159d9878121b78a 100644 (file)
 #include <common/config/session-config.h>
 #include <lttng/lttng.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 /* Don't want to reference snapshot-internal.h here */
 struct lttng_snapshot_output;
 
@@ -1121,8 +1117,4 @@ int mi_lttng_rotate(struct mi_writer *writer,
                enum lttng_rotation_state rotation_state,
                const struct lttng_trace_archive_location *location);
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* _MI_LTTNG_H */
index af8519ab32641aaab739fa66985179ee025b47ba..deaa9655ce2d23de89f46568e9017512c0af6cda 100644 (file)
 #include <common/buffer-view.h>
 #include <common/dynamic-array.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_payload;
 struct fd_handle;
 
@@ -51,24 +47,7 @@ struct lttng_payload_view {
        struct lttng_buffer_view buffer;
        /* private */
 
-       /*
-        * Avoid a -Wreturn-type-c-linkage warning with clang.
-        * gcc is more permissive with regards to this warning, but
-        * clang is right that a structure containing a _const_ structure is not
-        * a trivial type in the eyes of the C++ standard, theoritically affecting its
-        * compatibility with C from an ABI standpoint:
-        *   A trivial class is a class that is trivially copyable and has one or
-        *   more default constructors, all of which are either trivial or deleted and
-        *   at least one of which is not deleted.
-        *
-        * A const member implicitly deletes lttng_payload_view's constructor,
-        * making it non-trivial. This is not a problem for the moment as we are
-        * transitioning all code to C++11.
-        */
-#if !defined(__cplusplus)
-       const
-#endif
-       struct lttng_dynamic_pointer_array _fd_handles;
+       const struct lttng_dynamic_pointer_array _fd_handles;
 
        struct {
                size_t *p_fd_handles_position;
@@ -182,8 +161,4 @@ int lttng_payload_view_get_fd_handle_count(
 struct fd_handle *lttng_payload_view_pop_fd_handle(
                struct lttng_payload_view *payload_view);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_PAYLOAD_VIEW_H */
index e9bd8be9d5d2a48ad0a44c8db58edad3e3e4cffb..d6c0cc19ea8a214bdc58db403adad58155da3186 100644 (file)
 #include <common/dynamic-array.h>
 #include <common/fd-handle.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * An lttng_payload encompasses the 'data' (bytes) and any passed file
  * descriptors as part of a message between liblttng-ctl and the session
@@ -61,8 +57,4 @@ void lttng_payload_clear(struct lttng_payload *payload);
 int lttng_payload_push_fd_handle(struct lttng_payload *payload,
                struct fd_handle *fd_handle);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_PAYLOAD_H */
index b94d871e48426d57d9c88bc419bb659f46babebc..d9f43d66e03265d71342aeace9e4d91b5dd8bebc 100644 (file)
 #include <common/macros.h>
 #include <sys/types.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 enum lttng_pipe_state {
        LTTNG_PIPE_STATE_OPENED = 1,
        LTTNG_PIPE_STATE_CLOSED = 2,
@@ -85,8 +81,4 @@ int lttng_pipe_release_readfd(struct lttng_pipe *pipe);
 /* Returns and releases the write end of the pipe. */
 int lttng_pipe_release_writefd(struct lttng_pipe *pipe);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_PIPE_H */
index 9923e8128e7234474376a0563dd8cb7442f95c14..ac3668a5ae801c8461b3a0a0a0cd0413935f1c51 100644 (file)
 #include <unistd.h>
 #include <common/macros.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * lttng_read and lttng_write take care of EINTR and partial read/write.
  * Upon success, they return the "count" received as parameter.
@@ -26,8 +22,4 @@ extern "C" {
 ssize_t lttng_read(int fd, void *buf, size_t count);
 ssize_t lttng_write(int fd, const void *buf, size_t count);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_COMMON_READWRITE_H */
index 6053be796b0024277674fa0b5064e75a32e53572..1fbe22676445ed8defb5d3299a3219858a3579f1 100644 (file)
 #include <common/trace-chunk.h>
 #include <common/dynamic-array.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct relayd_stream_rotation_position {
        uint64_t stream_id;
        /*
@@ -81,8 +77,4 @@ int relayd_get_configuration(struct lttcomm_relayd_sock *sock,
                uint64_t query_flags,
                uint64_t *result_flags);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _RELAYD_H */
index ca084102e4ae8c17d424465c97016fb3c03a3698..406dfca2219220f86a91d0cae26017ac82f3e9e1 100644 (file)
 #include <common/macros.h>
 #include <common/sessiond-comm/sessiond-comm.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * The run-as process is launched by forking without an exec*() call. This means
  * that any resource allocated before the run-as worker is launched should be
@@ -65,8 +61,4 @@ int run_as_create_worker(const char *procname,
                post_fork_cleanup_cb clean_up_func, void *clean_up_user_data);
 void run_as_destroy_worker(void);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _RUNAS_H */
index 9aec36cf13c4e1b7650147b71ac22f921028e3e0..fd7cffedef1c11edb6d615e05b30f855365800cf 100644 (file)
 
 #include "sessiond-comm.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* See man tcp(7) for more detail about this value. */
 #define LTTCOMM_INET_PROC_SYN_RETRIES_PATH "/proc/sys/net/ipv4/tcp_syn_retries"
 #define LTTCOMM_INET_PROC_FIN_TIMEOUT_PATH "/proc/sys/net/ipv4/tcp_fin_timeout"
@@ -57,8 +53,4 @@ extern ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock,
 /* Initialize inet communication layer. */
 extern void lttcomm_inet_init(void);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _LTTCOMM_INET_H */
index b155fe4adc712ac688fc5279f1cb945cc2bbaf92..d81e0b8cf7bc12aa156d5159873b209c904f4737 100644 (file)
 #include "inet6.h"
 #include <common/unix.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* Queue size of listen(2) */
 #define LTTNG_SESSIOND_COMM_MAX_LISTEN 64
 
@@ -930,8 +926,4 @@ void lttcomm_init(void);
 /* Get network timeout, in milliseconds */
 unsigned long lttcomm_get_network_timeout(void);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _LTTNG_SESSIOND_COMM_H */
index 530507c35ae8ed8c839638501776f5749753f124..d714506b85b2f4a472a8186fad47c621126ed6ca 100644 (file)
@@ -9,16 +9,8 @@
 #ifndef _LTT_SHM_H
 #define _LTT_SHM_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 char *shm_ust_get_mmap(char *shm_path, int global);
 
 int shm_create_anonymous(const char *owner_name);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _LTT_SHM_H */
index dc7b7bbcbb0340484c434d8aaa5f77add805bb1c..1221c5b08c51f21474282f9aa45efc343011ca84 100644 (file)
 #include <lttng/lttng-export.h>
 #include <stdbool.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 /*
  * Read the trace by `exec()ing` the provided viewer program if any. If
  * `opt_viewer` is NULL, try to read the trace with the default trace reader.
@@ -25,10 +21,7 @@ extern "C" {
  * This symbol was mistakenly made public before the 2.12 release. It can't
  * be removed (but it can be stubbed-out if necessary).
  */
-LTTNG_EXPORT int spawn_viewer(const char *trace_path, char *opt_viewer, bool opt_live_mode);
-
-#if defined(__cplusplus)
-}
-#endif
+extern "C" LTTNG_EXPORT
+int spawn_viewer(const char *trace_path, char *opt_viewer, bool opt_live_mode);
 
 #endif /* ifndef LTTNG_SPAWN_VIEWER_H */
index fb795b9ddf9a5bec07e63da880da75788995e2d1..1cf31e9d4b97df486ec1b0a1a0ec1d107f8562ba 100644 (file)
 #include <common/macros.h>
 #include <common/dynamic-array.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 void strutils_normalize_star_glob_pattern(char *pattern);
 
 bool strutils_is_star_glob_pattern(const char *pattern);
@@ -31,8 +27,4 @@ void strutils_free_null_terminated_array_of_strings(char **array);
 
 size_t strutils_array_of_strings_len(char * const *array);
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* _STRING_UTILS_H */
index b613b1749dab4d4258bffc0857ad745d4883fe74..33cb9aa340cc71e64939be17844aaea3e42fa26c 100644 (file)
 
 #include <urcu.h> /* for caa_likely/unlikely */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 extern int lttng_testpoint_activated;
 
 void *lttng_testpoint_lookup(const char *name);
@@ -63,8 +59,4 @@ void *lttng_testpoint_lookup(const char *name);
 #define TESTPOINT_DECL(name)   \
        _TESTPOINT_DECL(name)
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* NTESTPOINT */
index dc3f7634223ed8c79810c7f3c98cd117864a8f27..87adf17d75d40af2945ef392bb45129bb777d11b 100644 (file)
 #include <common/macros.h>
 #include <common/compat/time.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 #define MSEC_PER_SEC    1000ULL
 #define NSEC_PER_SEC    1000000000ULL
 #define NSEC_PER_MSEC   1000000ULL
@@ -66,8 +62,4 @@ int time_to_iso8601_str(time_t time, char *str, size_t len);
 
 int time_to_datetime_str(time_t time, char *str, size_t len);
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* LTTNG_TIME_H */
index f61e560808486c37b1640d3ed04bce0a6cf48555..0eee0c21c4e918ce14d2c6ebccc8f21cf25c9379 100644 (file)
 #include <common/macros.h>
 #include <common/trace-chunk.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_trace_chunk_registry;
 
 /*
@@ -96,8 +92,4 @@ lttng_trace_chunk_registry_find_anonymous_chunk(
 unsigned int lttng_trace_chunk_registry_put_each_chunk(
                const struct lttng_trace_chunk_registry *registry);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_TRACE_CHUNK_REGISTRY_H */
index 9bb4f3708319ea03f46a47532da772315f5f73d3..4e4440b6afc19db02a810e7181183147305b1fc6 100644 (file)
 #include <stddef.h>
 #include <stdint.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * A trace chunk is a group of directories and files forming a (or a set of)
  * complete and independant trace(s). For instance, a trace archive chunk,
@@ -186,8 +182,4 @@ bool lttng_trace_chunk_get(struct lttng_trace_chunk *chunk);
 
 void lttng_trace_chunk_put(struct lttng_trace_chunk *chunk);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_TRACE_CHUNK_H */
index e81ee309e7e91527861eb6090475ba645f814bbd..8b37940493ea391784dc4bad6417578e3deb1b2b 100644 (file)
 #include <common/macros.h>
 #include <common/sessiond-comm/sessiond-comm.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 struct process_attr_value {
        enum lttng_process_attr_value_type type;
        union value {
@@ -80,8 +76,4 @@ enum lttng_error_code process_attr_value_from_comm(
                const struct lttng_buffer_view *value_view,
                struct process_attr_value **value);
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* LTTNG_COMMON_TRACKER_H */
index e5c7435e34eb7256047304133d642eeeaf26e178..820dff0b56893f86edeb1f40f8e289a8a0b6d6b3 100644 (file)
 #include <common/payload.h>
 #include <common/payload-view.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 int lttcomm_create_unix_sock(const char *pathname);
 int lttcomm_create_anon_unix_socketpair(int *fds);
 int lttcomm_connect_unix_sock(const char *pathname);
@@ -55,8 +51,4 @@ ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len,
 
 int lttcomm_setsockopt_creds_unix_sock(int sock);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _LTTCOMM_UNIX_H */
index 3a02dda5c228f7b676f5ae966f27991afcb812ec..b0af0326810e851556ab84f7cad6bb84295dbc68 100644 (file)
 #include <lttng/lttng.h>
 #include <common/macros.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 /* Destination type of lttng URI */
 enum lttng_dst_type {
        LTTNG_DST_IPV4                        = 1,
@@ -77,8 +73,4 @@ ssize_t uri_parse_str_urls(const char *ctrl_url, const char *data_url,
                struct lttng_uri **uris);
 int uri_to_str_url(struct lttng_uri *uri, char *dst, size_t size);
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* _LTT_URI_H */
index 29ae853daa54d90fb8f2a008f0a84aeda94aeb64..e2507a7f441da932809adb3220e22bb803e9ec32 100644 (file)
 #include <common/consumer/consumer.h>
 #include <stdbool.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #ifdef HAVE_LIBLTTNG_UST_CTL
 
 int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream);
@@ -244,8 +240,4 @@ void lttng_ustconsumer_sigbus_handle(void *addr)
 }
 #endif /* HAVE_LIBLTTNG_UST_CTL */
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _LTTNG_USTCONSUMER_H */
index 6e478b39eb3609f90aa3ad1ab3b5a4200754411c..a3250639becd448d38a10e61ef47287709256204 100644 (file)
 
 #include <common/compat/directory-handle.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 #define KIBI_LOG2 10
 #define MEBI_LOG2 20
 #define GIBI_LOG2 30
@@ -72,8 +68,4 @@ enum lttng_error_code utils_group_id_from_name(
 int utils_parse_unsigned_long_long(const char *str,
                unsigned long long *value);
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* _COMMON_UTILS_H */
index d95ea062e20e9d38d3141e54d7704efdb36591d1..0d3e79aeeb4ad572a99c11680051750c8c304289 100644 (file)
 #include <stdint.h>
 #include <inttypes.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*
  * Includes final \0.
  */
@@ -63,8 +59,4 @@ void lttng_uuid_copy(lttng_uuid dst, const lttng_uuid src);
  */
 int lttng_uuid_generate(lttng_uuid uuid_out);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_UUID_H */
index 30b51ee803b4e1f61efced2d700cbc74265f44a8..ed870aeb071eb5095b9980417c5dba8c7c4ad5b1 100644 (file)
 #include <stdbool.h>
 #include "macros.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct lttng_waiter {
        struct cds_wfs_node wait_queue_node;
        int32_t state;
@@ -37,8 +33,4 @@ void lttng_waiter_wait(struct lttng_waiter *waiter);
  */
 void lttng_waiter_wake_up(struct lttng_waiter *waiter);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* LTTNG_WAITER_H */
This page took 0.061552 seconds and 4 git commands to generate.