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