Эх сурвалжийг харах

Add missing C++ macros in public headers

Thanks to Bernhard Agthe.
Stéphane Raimbault 13 жил өмнө
parent
commit
3519a7956d
2 өөрчлөгдсөн 8 нэмэгдсэн , 0 устгасан
  1. 4 0
      src/modbus-rtu.h
  2. 4 0
      src/modbus-tcp.h

+ 4 - 0
src/modbus-rtu.h

@@ -21,6 +21,8 @@
 
 #include "modbus.h"
 
+MODBUS_BEGIN_DECLS
+
 /* Modbus_Application_Protocol_V1_1b.pdf Chapter 4 Section 1 Page 5
  * RS232 / RS485 ADU = 253 bytes + slave (1 byte) + CRC (2 bytes) = 256 bytes
  */
@@ -35,4 +37,6 @@ modbus_t* modbus_new_rtu(const char *device, int baud, char parity,
 int modbus_rtu_set_serial_mode(modbus_t *ctx, int mode);
 int modbus_rtu_get_serial_mode(modbus_t *ctx);
 
+MODBUS_END_DECLS
+
 #endif /* _MODBUS_RTU_H_ */

+ 4 - 0
src/modbus-tcp.h

@@ -21,6 +21,8 @@
 
 #include "modbus.h"
 
+MODBUS_BEGIN_DECLS
+
 #if defined(_WIN32) && !defined(__CYGWIN__)
 /* Win32 with MinGW, supplement to <errno.h> */
 #include <winsock2.h>
@@ -46,4 +48,6 @@ modbus_t* modbus_new_tcp_pi(const char *node, const char *service);
 int modbus_tcp_pi_listen(modbus_t *ctx, int nb_connection);
 int modbus_tcp_pi_accept(modbus_t *ctx, int *socket);
 
+MODBUS_END_DECLS
+
 #endif /* _MODBUS_TCP_H_ */