Commit 2e9da98ca529e3532fdbfd083e775441245cf342

Authored by Matthias Weisser
Committed by Stéphane Raimbault
1 parent 1d4241df

Make modbus.h more self contained

If <sys/time.h> is not included before "modbus.h" as struct timeval
is not declared. This behavior was observed while building libmodbus
for QNX.

Signed-off-by: Matthias Weisser <weisserm@arcor.de>
Showing 2 changed files with 1 additions and 1 deletions
src/modbus.c
@@ -38,7 +38,6 @@ @@ -38,7 +38,6 @@
38 #include <stdint.h> 38 #include <stdint.h>
39 #endif 39 #endif
40 #include <termios.h> 40 #include <termios.h>
41 -#include <sys/time.h>  
42 #include <unistd.h> 41 #include <unistd.h>
43 #include <errno.h> 42 #include <errno.h>
44 #include <assert.h> 43 #include <assert.h>
src/modbus.h
@@ -37,6 +37,7 @@ @@ -37,6 +37,7 @@
37 #include <netinet/ip.h> 37 #include <netinet/ip.h>
38 #include <netinet/tcp.h> 38 #include <netinet/tcp.h>
39 #include <arpa/inet.h> 39 #include <arpa/inet.h>
  40 +#include <sys/time.h>
40 41
41 #include "modbus-version.h" 42 #include "modbus-version.h"
42 43