Commit 680e90f4176b78583e956bbe985952c99f9abf6d

Authored by Stéphane Raimbault
1 parent c2d93bb0

Fix #224485 reported by Todd Denniston

libmodbus does not link with c++ code.
Showing 2 changed files with 10 additions and 0 deletions
... ... @@ -27,6 +27,8 @@ libmodbus 1.9.x
27 27 modbus.h is not installed at prefix.
28 28 - Fix #211460 reported by Todd Denniston
29 29 With TCP, automatic reconnect on error may not be desired.
  30 +- Fix #224485 reported by Todd Denniston
  31 + libmodbus does not link with c++ code.
30 32  
31 33 libmodbus 1.2.4 (2008-03-14)
32 34 - Fix #191039 reported by Todd Denniston
... ...
modbus/modbus.h
... ... @@ -24,6 +24,10 @@
24 24 #include <termios.h>
25 25 #include <arpa/inet.h>
26 26  
  27 +#ifdef __cplusplus
  28 +extern "C" {
  29 +#endif
  30 +
27 31 #define MODBUS_TCP_DEFAULT_PORT 502
28 32  
29 33 #define HEADER_LENGTH_RTU 0
... ... @@ -303,4 +307,8 @@ void set_bits_from_bytes(uint8_t *dest, int address, int nb_bits,
303 307 To obtain a full byte, set nb_bits to 8. */
304 308 uint8_t get_byte_from_bits(const uint8_t *src, int address, int nb_bits);
305 309  
  310 +#ifdef __cplusplus
  311 +}
  312 +#endif
  313 +
306 314 #endif /* _MODBUS_H_ */
... ...