From 8ced7ae1e14d3d8db819ec7ba4f890525f34c92a Mon Sep 17 00:00:00 2001 From: BlueAndi Date: Tue, 29 Oct 2024 23:22:03 +0100 Subject: [PATCH 1/3] Add missing extern "C" sections to the event headers. --- src/events/vscp_evt_alarm.h | 9 +++++++++ src/events/vscp_evt_aol.h | 9 +++++++++ src/events/vscp_evt_configuration.h | 9 +++++++++ src/events/vscp_evt_control.h | 9 +++++++++ src/events/vscp_evt_data.h | 9 +++++++++ src/events/vscp_evt_diagnostic.h | 9 +++++++++ src/events/vscp_evt_display.h | 9 +++++++++ src/events/vscp_evt_error.h | 9 +++++++++ src/events/vscp_evt_gnss.h | 9 +++++++++ src/events/vscp_evt_information.h | 9 +++++++++ src/events/vscp_evt_ir.h | 9 +++++++++ src/events/vscp_evt_log.h | 9 +++++++++ src/events/vscp_evt_measurement.h | 9 +++++++++ src/events/vscp_evt_measurement32.h | 9 +++++++++ src/events/vscp_evt_measurement64.h | 9 +++++++++ src/events/vscp_evt_measurezone.h | 9 +++++++++ src/events/vscp_evt_multimedia.h | 9 +++++++++ src/events/vscp_evt_phone.h | 9 +++++++++ src/events/vscp_evt_protocol.h | 9 +++++++++ src/events/vscp_evt_security.h | 9 +++++++++ src/events/vscp_evt_setvaluezone.h | 9 +++++++++ src/events/vscp_evt_weather.h | 9 +++++++++ src/events/vscp_evt_weather_forecast.h | 9 +++++++++ src/events/vscp_evt_wireless.h | 9 +++++++++ tools/scripts/vscp-protocol2vscp-events.xsl | 8 ++++++++ .../scripts/vscp-protocol2vscp-type-headers.xsl | 11 ++++------- tools/xslt/utilities/ctools.xsl | 17 +++++++++++++++++ 27 files changed, 245 insertions(+), 7 deletions(-) diff --git a/src/events/vscp_evt_alarm.h b/src/events/vscp_evt_alarm.h index 93171eb..1ecc797 100644 --- a/src/events/vscp_evt_alarm.h +++ b/src/events/vscp_evt_alarm.h @@ -49,6 +49,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -225,4 +230,8 @@ extern BOOL vscp_evt_alarm_sendWatchdog(uint8_t index, uint8_t zone, uint8_t sub */ extern BOOL vscp_evt_alarm_sendAlarmReset(uint8_t alarmRegister, uint8_t zone, uint8_t subZone); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_ALARM_H__ */ diff --git a/src/events/vscp_evt_aol.h b/src/events/vscp_evt_aol.h index e5a2ef2..669a797 100644 --- a/src/events/vscp_evt_aol.h +++ b/src/events/vscp_evt_aol.h @@ -49,6 +49,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -256,4 +261,8 @@ extern BOOL vscp_evt_aol_sendUpdateBiosImage(uint8_t index, uint8_t zone, uint8_ */ extern BOOL vscp_evt_aol_sendUpdatePerformOtherDiagnosticProcedures(uint8_t index, uint8_t zone, uint8_t subZone); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_AOL_H__ */ diff --git a/src/events/vscp_evt_configuration.h b/src/events/vscp_evt_configuration.h index 34ffc6b..2ffd886 100644 --- a/src/events/vscp_evt_configuration.h +++ b/src/events/vscp_evt_configuration.h @@ -48,6 +48,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -279,4 +284,8 @@ extern BOOL vscp_evt_configuration_sendSetParameterAcknowledge(uint16_t paramete */ extern BOOL vscp_evt_configuration_sendSetParamterNegativeAcknowledge(uint16_t parameterid, uint16_t parametervalue); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_CONFIGURATION_H__ */ diff --git a/src/events/vscp_evt_control.h b/src/events/vscp_evt_control.h index ef4c86e..514d9ba 100644 --- a/src/events/vscp_evt_control.h +++ b/src/events/vscp_evt_control.h @@ -52,6 +52,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -685,4 +690,8 @@ extern BOOL vscp_evt_control_sendIncrement(uint8_t userSpecific, uint8_t zone, u */ extern BOOL vscp_evt_control_sendDecrement(uint8_t userSpecific, uint8_t zone, uint8_t subzone, uint8_t const * const decrementValue, uint8_t decrementValueSize); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_CONTROL_H__ */ diff --git a/src/events/vscp_evt_data.h b/src/events/vscp_evt_data.h index c36cb28..fd9a3a9 100644 --- a/src/events/vscp_evt_data.h +++ b/src/events/vscp_evt_data.h @@ -49,6 +49,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -152,4 +157,8 @@ extern BOOL vscp_evt_data_sendSignalLevel(uint8_t index, uint8_t unit, int32_t d */ extern BOOL vscp_evt_data_sendSignalQuality(uint8_t index, uint8_t unit, int32_t data, int8_t exp); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_DATA_H__ */ diff --git a/src/events/vscp_evt_diagnostic.h b/src/events/vscp_evt_diagnostic.h index aa9ea08..d95ba56 100644 --- a/src/events/vscp_evt_diagnostic.h +++ b/src/events/vscp_evt_diagnostic.h @@ -48,6 +48,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -1213,4 +1218,8 @@ extern BOOL vscp_evt_diagnostic_sendChargingOn(uint8_t index, uint8_t zone, uint */ extern BOOL vscp_evt_diagnostic_sendChargingOff(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t const * const user, uint8_t userSize); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_DIAGNOSTIC_H__ */ diff --git a/src/events/vscp_evt_display.h b/src/events/vscp_evt_display.h index c904f8c..67a8614 100644 --- a/src/events/vscp_evt_display.h +++ b/src/events/vscp_evt_display.h @@ -48,6 +48,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -193,4 +198,8 @@ extern BOOL vscp_evt_display_sendSetLed(uint8_t index, uint8_t zone, uint8_t sub */ extern BOOL vscp_evt_display_sendSetRgbColor(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t red, uint8_t green, uint8_t blue); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_DISPLAY_H__ */ diff --git a/src/events/vscp_evt_error.h b/src/events/vscp_evt_error.h index d99279f..2287fb0 100644 --- a/src/events/vscp_evt_error.h +++ b/src/events/vscp_evt_error.h @@ -48,6 +48,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -604,4 +609,8 @@ extern BOOL vscp_evt_error_sendOperationStoppedOrAborted(uint8_t index, uint8_t */ extern BOOL vscp_evt_error_sendPointerWithInvalidValue(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t const * const user, uint8_t userSize); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_ERROR_H__ */ diff --git a/src/events/vscp_evt_gnss.h b/src/events/vscp_evt_gnss.h index 57826b5..b059962 100644 --- a/src/events/vscp_evt_gnss.h +++ b/src/events/vscp_evt_gnss.h @@ -50,6 +50,11 @@ This file is automatically generated. Don't change it manually. #include "vscp_platform.h" #include +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -100,4 +105,8 @@ extern BOOL vscp_evt_gnss_sendPosition(float_t latitude, float_t longitude); */ extern BOOL vscp_evt_gnss_sendSatellites(uint8_t count); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_GNSS_H__ */ diff --git a/src/events/vscp_evt_information.h b/src/events/vscp_evt_information.h index b9e5093..6b8dac9 100644 --- a/src/events/vscp_evt_information.h +++ b/src/events/vscp_evt_information.h @@ -50,6 +50,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -1093,4 +1098,8 @@ extern BOOL vscp_evt_information_sendDecremented(uint8_t userSpecific, uint8_t z */ extern BOOL vscp_evt_information_sendProximityDetected(uint8_t userSpecific, uint8_t zone, uint8_t subzone, uint16_t const * const proximityLevel); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_INFORMATION_H__ */ diff --git a/src/events/vscp_evt_ir.h b/src/events/vscp_evt_ir.h index 88635e5..aaa5347 100644 --- a/src/events/vscp_evt_ir.h +++ b/src/events/vscp_evt_ir.h @@ -48,6 +48,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -142,4 +147,8 @@ extern BOOL vscp_evt_ir_sendVscpAbstractRemoteFormat(uint16_t code, uint8_t zone */ extern BOOL vscp_evt_ir_sendMapitoRemoteFormat(uint8_t repeat, uint8_t zone, uint8_t subZone, uint32_t address, uint8_t keyCode); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_IR_H__ */ diff --git a/src/events/vscp_evt_log.h b/src/events/vscp_evt_log.h index 4e444b1..5879f2d 100644 --- a/src/events/vscp_evt_log.h +++ b/src/events/vscp_evt_log.h @@ -48,6 +48,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -119,4 +124,8 @@ extern BOOL vscp_evt_log_sendLogStop(uint8_t id); */ extern BOOL vscp_evt_log_sendLogLevel(uint8_t level); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_LOG_H__ */ diff --git a/src/events/vscp_evt_measurement.h b/src/events/vscp_evt_measurement.h index dc4df9c..c27687c 100644 --- a/src/events/vscp_evt_measurement.h +++ b/src/events/vscp_evt_measurement.h @@ -50,6 +50,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -841,4 +846,8 @@ extern BOOL vscp_evt_measurement_sendReactivePower(uint8_t index, uint8_t unit, */ extern BOOL vscp_evt_measurement_sendReactiveEnergy(uint8_t index, uint8_t unit, int32_t data, int8_t exp); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_MEASUREMENT_H__ */ diff --git a/src/events/vscp_evt_measurement32.h b/src/events/vscp_evt_measurement32.h index aedf7f6..f48e122 100644 --- a/src/events/vscp_evt_measurement32.h +++ b/src/events/vscp_evt_measurement32.h @@ -50,6 +50,11 @@ This file is automatically generated. Don't change it manually. #include "vscp_platform.h" #include +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -652,4 +657,8 @@ extern BOOL vscp_evt_measurement32_sendReactivePower(float_t value); */ extern BOOL vscp_evt_measurement32_sendReactiveEnergy(float_t value); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_MEASUREMENT32_H__ */ diff --git a/src/events/vscp_evt_measurement64.h b/src/events/vscp_evt_measurement64.h index f9a8581..61ca824 100644 --- a/src/events/vscp_evt_measurement64.h +++ b/src/events/vscp_evt_measurement64.h @@ -50,6 +50,11 @@ This file is automatically generated. Don't change it manually. #include "vscp_platform.h" #include +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -652,4 +657,8 @@ extern BOOL vscp_evt_measurement64_sendReactivePower(double_t value); */ extern BOOL vscp_evt_measurement64_sendReactiveEnergy(double_t value); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_MEASUREMENT64_H__ */ diff --git a/src/events/vscp_evt_measurezone.h b/src/events/vscp_evt_measurezone.h index f33968c..f9bd9bb 100644 --- a/src/events/vscp_evt_measurezone.h +++ b/src/events/vscp_evt_measurezone.h @@ -51,6 +51,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -905,4 +910,8 @@ extern BOOL vscp_evt_measurezone_sendReactivePower(uint8_t index, uint8_t zone, */ extern BOOL vscp_evt_measurezone_sendReactiveEnergy(uint8_t index, uint8_t zone, uint8_t subZone, int32_t data, int8_t exp); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_MEASUREZONE_H__ */ diff --git a/src/events/vscp_evt_multimedia.h b/src/events/vscp_evt_multimedia.h index 23185c9..d4ded64 100644 --- a/src/events/vscp_evt_multimedia.h +++ b/src/events/vscp_evt_multimedia.h @@ -49,6 +49,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -531,4 +536,8 @@ extern BOOL vscp_evt_multimedia_sendMultimediaControl(uint8_t control, uint8_t z /* "Multimedia Control response" not supported. No frame defined. */ +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_MULTIMEDIA_H__ */ diff --git a/src/events/vscp_evt_phone.h b/src/events/vscp_evt_phone.h index d4eb24e..0476f3f 100644 --- a/src/events/vscp_evt_phone.h +++ b/src/events/vscp_evt_phone.h @@ -48,6 +48,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -171,4 +176,8 @@ extern BOOL vscp_evt_phone_sendTransfer(uint8_t id); */ extern BOOL vscp_evt_phone_sendDatabaseInfo(uint8_t id, uint8_t index, uint8_t total, uint8_t const * const info, uint8_t infoSize); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_PHONE_H__ */ diff --git a/src/events/vscp_evt_protocol.h b/src/events/vscp_evt_protocol.h index 2ee1704..6fb6afe 100644 --- a/src/events/vscp_evt_protocol.h +++ b/src/events/vscp_evt_protocol.h @@ -54,6 +54,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -508,4 +513,8 @@ extern BOOL vscp_evt_protocol_sendBlockDataTransferAck(void); */ extern BOOL vscp_evt_protocol_sendBlockDataTransferNack(void); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_PROTOCOL_H__ */ diff --git a/src/events/vscp_evt_security.h b/src/events/vscp_evt_security.h index 48bae58..180d3a4 100644 --- a/src/events/vscp_evt_security.h +++ b/src/events/vscp_evt_security.h @@ -48,6 +48,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -487,4 +492,8 @@ extern BOOL vscp_evt_security_sendNotInMotion(uint8_t data0, uint8_t zone, uint8 */ extern BOOL vscp_evt_security_sendVibration(uint8_t data0, uint8_t zone, uint8_t subZone); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_SECURITY_H__ */ diff --git a/src/events/vscp_evt_setvaluezone.h b/src/events/vscp_evt_setvaluezone.h index 0ca1b12..19a17c2 100644 --- a/src/events/vscp_evt_setvaluezone.h +++ b/src/events/vscp_evt_setvaluezone.h @@ -49,6 +49,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -896,4 +901,8 @@ extern BOOL vscp_evt_setvaluezone_sendSoundEnergyDensity(uint8_t index, uint8_t */ extern BOOL vscp_evt_setvaluezone_sendSoundLevel(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t dataCoding, uint8_t const * const data, uint8_t dataSize); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_SETVALUEZONE_H__ */ diff --git a/src/events/vscp_evt_weather.h b/src/events/vscp_evt_weather.h index e7f4ca0..0c837ff 100644 --- a/src/events/vscp_evt_weather.h +++ b/src/events/vscp_evt_weather.h @@ -48,6 +48,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -652,4 +657,8 @@ extern BOOL vscp_evt_weather_sendArmageddon(uint8_t index, uint8_t zone, uint8_t */ extern BOOL vscp_evt_weather_sendUvIndex(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t uvIndex); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_WEATHER_H__ */ diff --git a/src/events/vscp_evt_weather_forecast.h b/src/events/vscp_evt_weather_forecast.h index bcacf91..30bd5db 100644 --- a/src/events/vscp_evt_weather_forecast.h +++ b/src/events/vscp_evt_weather_forecast.h @@ -48,6 +48,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -652,4 +657,8 @@ extern BOOL vscp_evt_weather_forecast_sendArmageddon(uint8_t index, uint8_t zone */ extern BOOL vscp_evt_weather_forecast_sendUvIndex(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t uvIndex); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_WEATHER_FORECAST_H__ */ diff --git a/src/events/vscp_evt_wireless.h b/src/events/vscp_evt_wireless.h index 1d71213..1a795fe 100644 --- a/src/events/vscp_evt_wireless.h +++ b/src/events/vscp_evt_wireless.h @@ -48,6 +48,11 @@ This file is automatically generated. Don't change it manually. #include #include "vscp_platform.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ @@ -88,4 +93,8 @@ extern BOOL vscp_evt_wireless_sendGeneralEvent(void); */ extern BOOL vscp_evt_wireless_sendGsmCell(uint32_t count); +#ifdef __cplusplus +} +#endif + #endif /* __VSCP_EVT_WIRELESS_H__ */ diff --git a/tools/scripts/vscp-protocol2vscp-events.xsl b/tools/scripts/vscp-protocol2vscp-events.xsl index 026ec90..ff3998d 100644 --- a/tools/scripts/vscp-protocol2vscp-events.xsl +++ b/tools/scripts/vscp-protocol2vscp-events.xsl @@ -326,6 +326,10 @@ This transformation script generates the VSCP event modules. &LF; + + + + &LF; @@ -380,6 +384,10 @@ This transformation script generates the VSCP event modules. + + + &LF; + diff --git a/tools/scripts/vscp-protocol2vscp-type-headers.xsl b/tools/scripts/vscp-protocol2vscp-type-headers.xsl index abd9ba5..9e88560 100644 --- a/tools/scripts/vscp-protocol2vscp-type-headers.xsl +++ b/tools/scripts/vscp-protocol2vscp-type-headers.xsl @@ -259,10 +259,8 @@ This transformation script generates the VSCP type C header files. &LF; - #ifdef __cplusplus&LF; - extern "C"&LF; - {&LF; - #endif&LF; + + &LF; @@ -323,9 +321,8 @@ This transformation script generates the VSCP type C header files. &LF; - #ifdef __cplusplus&LF; - }&LF; - #endif&LF; + + &LF; diff --git a/tools/xslt/utilities/ctools.xsl b/tools/xslt/utilities/ctools.xsl index a75a082..8a07031 100644 --- a/tools/xslt/utilities/ctools.xsl +++ b/tools/xslt/utilities/ctools.xsl @@ -252,6 +252,23 @@ Templates to support the generation of C-modules. + + + #ifdef __cplusplus&LF; + extern "C"&LF; + {&LF; + #endif&LF; + + + + + #ifdef __cplusplus&LF; + }&LF; + #endif&LF; + +