Skip to content

Commit

Permalink
HAVE_NETINET_IN_H as guard around header
Browse files Browse the repository at this point in the history
Hi,

it does not make sense to have this in a config.h, and then still include it when HAVE_NETINET_IN_H is 0.

This fix solves this.
  • Loading branch information
diplfranzhoepfinger committed Aug 18, 2024
1 parent dde16d5 commit 827c264
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modbus-tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@
# include <netinet/in_systm.h>
#endif

# include <netinet/in.h>
# include <netinet/ip.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
#ifdef HAVE_NETINET_IP_H
#include <netinet/ip.h>
#endif /* HAVE_NETINET_IP_H */
# include <netinet/tcp.h>
# include <arpa/inet.h>
# include <netdb.h>
Expand Down
2 changes: 2 additions & 0 deletions tests/bandwidth-server-many-up.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
#include <ws2tcpip.h>
#else
#include <arpa/inet.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
#include <sys/select.h>
#include <sys/socket.h>
#endif
Expand Down

0 comments on commit 827c264

Please sign in to comment.