Commit e3f2c133fa8d167f275bb93fff073fbbc4cdbf2f

Authored by Stéphane Raimbault
1 parent 77eceb6a

Remove inclusion of config.h in modbus.h. Closes GH-3.

Reported by Ivan Giuliani <giuliani.v@gmail.com>
It was not possible to use libmodbus outside of projects without
config.h file.

The inclusion has been removed from the public header.

Signed-off-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
configure.ac
... ... @@ -28,7 +28,7 @@ AC_CONFIG_SRCDIR([src/modbus.c])
28 28 AC_CONFIG_HEADERS([config.h])
29 29 AM_INIT_AUTOMAKE([foreign])
30 30 # enable nice build output on automake1.11
31   -m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  31 +#m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
32 32  
33 33 LIBMODBUS_VERSION_MAJOR=libmodbus_version_major
34 34 LIBMODBUS_VERSION_MINOR=libmodbus_version_minor
... ...
src/modbus-private.h
... ... @@ -22,6 +22,7 @@
22 22 #include <sys/types.h>
23 23 #include <stdint.h>
24 24  
  25 +#include <config.h>
25 26 #include "modbus.h"
26 27  
27 28 MODBUS_BEGIN_DECLS
... ...
src/modbus.c
... ... @@ -26,6 +26,8 @@
26 26 #include <errno.h>
27 27 #include <limits.h>
28 28  
  29 +#include <config.h>
  30 +
29 31 #include "modbus.h"
30 32 #include "modbus-private.h"
31 33  
... ...
src/modbus.h
... ... @@ -18,8 +18,6 @@
18 18 #ifndef _MODBUS_H_
19 19 #define _MODBUS_H_
20 20  
21   -#include <config.h>
22   -
23 21 /* Add this for macros that defined unix flavor */
24 22 #if (defined(__unix__) || defined(unix)) && !defined(USG)
25 23 #include <sys/param.h>
... ...
tests/unit-test.h
... ... @@ -18,6 +18,8 @@
18 18 #ifndef _UNIT_TEST_H_
19 19 #define _UNIT_TEST_H_
20 20  
  21 +#include <config.h>
  22 +
21 23 #ifdef HAVE_INTTYPES_H
22 24 #include <inttypes.h>
23 25 #endif
... ...