diff --git a/NEWS b/NEWS index cd26765..810a8f7 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,8 @@ libmodbus 1.9.x modbus.h is not installed at prefix. - Fix #211460 reported by Todd Denniston With TCP, automatic reconnect on error may not be desired. +- Fix #224485 reported by Todd Denniston + libmodbus does not link with c++ code. libmodbus 1.2.4 (2008-03-14) - Fix #191039 reported by Todd Denniston diff --git a/modbus/modbus.h b/modbus/modbus.h index e7473a9..411a79d 100644 --- a/modbus/modbus.h +++ b/modbus/modbus.h @@ -24,6 +24,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define MODBUS_TCP_DEFAULT_PORT 502 #define HEADER_LENGTH_RTU 0 @@ -303,4 +307,8 @@ void set_bits_from_bytes(uint8_t *dest, int address, int nb_bits, To obtain a full byte, set nb_bits to 8. */ uint8_t get_byte_from_bits(const uint8_t *src, int address, int nb_bits); +#ifdef __cplusplus +} +#endif + #endif /* _MODBUS_H_ */