From: Kienan Stewart Date: Mon, 16 Dec 2024 14:36:46 +0000 (-0500) Subject: session-config: Correct `config_xml_encoding_bytes_per_char`'s exported type X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2282b413af6323cade15c70115192d40acbcd6e0;p=lttng-tools.git session-config: Correct `config_xml_encoding_bytes_per_char`'s exported type The ABI diff reports the following variable type change: ``` 1 Changed variable: [C] 'const size_t config_xml_encoding_bytes_per_char' was changed to 'std::size_t config_xml_encoding_bytes_per_char' at session -config.cpp:55:1: type of variable changed: entity changed from 'const size_t' to 'typedef std::size_t' at c++config.h:310:1 type size hasn't changed ``` This patch also takes the opportunity to ensure that the "C" linkage is used for the exported variables. Change-Id: Id9739d290d1872bc803d2925ffa1d40b04c3e553 Signed-off-by: Kienan Stewart Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/config/session-config.cpp b/src/common/config/session-config.cpp index 719c2e876..043b4de07 100644 --- a/src/common/config/session-config.cpp +++ b/src/common/config/session-config.cpp @@ -49,15 +49,24 @@ struct session_config_validation_ctx { }; } /* namespace */ -const char *const config_element_all = "all"; +#ifdef __cpluslus +extern "C" { +#endif + LTTNG_EXPORT extern const char *const config_xml_encoding; -const char *const config_xml_encoding = "UTF-8"; -LTTNG_EXPORT size_t config_xml_encoding_bytes_per_char = 2; /* Size of the encoding's largest - character */ +LTTNG_EXPORT extern const size_t config_xml_encoding_bytes_per_char; /* Size of the encoding's + largest character */ LTTNG_EXPORT extern const char *const config_xml_indent_string; LTTNG_EXPORT extern const char *const config_xml_true; LTTNG_EXPORT extern const char *const config_xml_false; +#ifdef __cpluslus +} +#endif + +const char *const config_element_all = "all"; +const char *const config_xml_encoding = "UTF-8"; +const size_t config_xml_encoding_bytes_per_char = 2; const char *const config_xml_indent_string = "\t"; const char *const config_xml_true = "true"; const char *const config_xml_false = "false";