Commit 5d7cabc86c354bbca64df662024a747b034afb83
1 parent
ca602fcc
Add missing C++ macros in public headers
Thanks to Bernhard Agthe.
Showing
2 changed files
with
8 additions
and
0 deletions
src/modbus-rtu.h
| ... | ... | @@ -21,6 +21,8 @@ |
| 21 | 21 | |
| 22 | 22 | #include "modbus.h" |
| 23 | 23 | |
| 24 | +MODBUS_BEGIN_DECLS | |
| 25 | + | |
| 24 | 26 | /* Modbus_Application_Protocol_V1_1b.pdf Chapter 4 Section 1 Page 5 |
| 25 | 27 | * RS232 / RS485 ADU = 253 bytes + slave (1 byte) + CRC (2 bytes) = 256 bytes |
| 26 | 28 | */ |
| ... | ... | @@ -42,4 +44,6 @@ int modbus_rtu_get_serial_mode(modbus_t *ctx); |
| 42 | 44 | int modbus_rtu_set_rts(modbus_t *ctx, int mode); |
| 43 | 45 | int modbus_rtu_get_rts(modbus_t *ctx); |
| 44 | 46 | |
| 47 | +MODBUS_END_DECLS | |
| 48 | + | |
| 45 | 49 | #endif /* _MODBUS_RTU_H_ */ | ... | ... |
src/modbus-tcp.h
| ... | ... | @@ -21,6 +21,8 @@ |
| 21 | 21 | |
| 22 | 22 | #include "modbus.h" |
| 23 | 23 | |
| 24 | +MODBUS_BEGIN_DECLS | |
| 25 | + | |
| 24 | 26 | #if defined(_WIN32) && !defined(__CYGWIN__) |
| 25 | 27 | /* Win32 with MinGW, supplement to <errno.h> */ |
| 26 | 28 | #include <winsock2.h> |
| ... | ... | @@ -46,4 +48,6 @@ modbus_t* modbus_new_tcp_pi(const char *node, const char *service); |
| 46 | 48 | int modbus_tcp_pi_listen(modbus_t *ctx, int nb_connection); |
| 47 | 49 | int modbus_tcp_pi_accept(modbus_t *ctx, int *socket); |
| 48 | 50 | |
| 51 | +MODBUS_END_DECLS | |
| 52 | + | |
| 49 | 53 | #endif /* _MODBUS_TCP_H_ */ | ... | ... |