瀏覽代碼

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>
Stéphane Raimbault 14 年之前
父節點
當前提交
e3f2c133fa
共有 5 個文件被更改,包括 6 次插入3 次删除
  1. 1 1
      configure.ac
  2. 1 0
      src/modbus-private.h
  3. 2 0
      src/modbus.c
  4. 0 2
      src/modbus.h
  5. 2 0
      tests/unit-test.h

+ 1 - 1
configure.ac

@@ -28,7 +28,7 @@ AC_CONFIG_SRCDIR([src/modbus.c])
 AC_CONFIG_HEADERS([config.h])
 AM_INIT_AUTOMAKE([foreign])
 # enable nice build output on automake1.11
-m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
+#m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 
 LIBMODBUS_VERSION_MAJOR=libmodbus_version_major
 LIBMODBUS_VERSION_MINOR=libmodbus_version_minor

+ 1 - 0
src/modbus-private.h

@@ -22,6 +22,7 @@
 #include <sys/types.h>
 #include <stdint.h>
 
+#include <config.h>
 #include "modbus.h"
 
 MODBUS_BEGIN_DECLS

+ 2 - 0
src/modbus.c

@@ -26,6 +26,8 @@
 #include <errno.h>
 #include <limits.h>
 
+#include <config.h>
+
 #include "modbus.h"
 #include "modbus-private.h"
 

+ 0 - 2
src/modbus.h

@@ -18,8 +18,6 @@
 #ifndef _MODBUS_H_
 #define _MODBUS_H_
 
-#include <config.h>
-
 /* Add this for macros that defined unix flavor */
 #if (defined(__unix__) || defined(unix)) && !defined(USG)
 #include <sys/param.h>

+ 2 - 0
tests/unit-test.h

@@ -18,6 +18,8 @@
 #ifndef _UNIT_TEST_H_
 #define _UNIT_TEST_H_
 
+#include <config.h>
+
 #ifdef HAVE_INTTYPES_H
 #include <inttypes.h>
 #endif