Files that include both <config.h> and "system.h" might include
config.h twice. Prevent that by adding a guard check in system.h
before including config.h.
* lib/crc32.c: Use #ifdef HAVE_CONFIG_H instead of #if.
* lib/error.h: Check HAVE_CONFIG_H before including config.h.
* lib/system.h: Check both HAVE_CONFIG_H and whether
EU_CONFIG_H is defined before including config.h.
Suggested-by: Dmitry V. Levin <ldv@strace.io>
Signed-off-by: Mark Wielaard <mark@klomp.org>
the GNU Lesser General Public License along with this program. If
not, see <http://www.gnu.org/licenses/>. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
the GNU Lesser General Public License along with this program. If
not, see <http://www.gnu.org/licenses/>. */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#if !defined(HAVE_ERROR_H) && defined(HAVE_ERR_H)
#include <errno.h>
#ifndef LIB_SYSTEM_H
#define LIB_SYSTEM_H 1
-#include <config.h>
+/* Prevent double inclusion of config.h, config.h includes eu-config.h. */
+#ifdef HAVE_CONFIG_H
+#ifndef EU_CONFIG_H
+# include <config.h>
+#endif
+#endif
#include <errno.h>
#include <stdbool.h>