aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--configure.ac5
-rw-r--r--include/common.h4
3 files changed, 11 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index c11a45e..a5547d5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -124,6 +124,9 @@ tests/ubi-tests/ubi-stress-test.sh
/missing
/stamp-h?
/compile
+/include/config.h
+/include/config.h.in
+/include/stamp-h1
#
# Top-level generic files
diff --git a/configure.ac b/configure.ac
index 2fdf49c..a783990 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,6 +4,7 @@ m4_define([RELEASE], 1.5.2)
AC_INIT([mtd-utils], [RELEASE], [linux-mtd@lists.infradead.org], mtd-utils)
+AC_CONFIG_HEADERS([include/config.h])
AC_ARG_ENABLE([unit-tests],
[AS_HELP_STRING([--enable-unit-tests], [Compile unit test programs])],
@@ -109,4 +110,8 @@ AM_COND_IF([WITHOUT_LZO], [], [
test "${have_lzo}" != "yes" && AC_MSG_ERROR([lzo missing])
])
+AC_CHECK_SIZEOF([long])
+
+AC_CHECK_SIZEOF([loff_t])
+
AC_OUTPUT([Makefile])
diff --git a/include/common.h b/include/common.h
index 4f0bb9b..93ef7f3 100644
--- a/include/common.h
+++ b/include/common.h
@@ -30,6 +30,8 @@
#include <inttypes.h>
#include <sys/sysmacros.h>
+#include "config.h"
+
#ifndef PROGRAM_NAME
# error "You must define PROGRAM_NAME before including this header"
#endif
@@ -71,7 +73,7 @@ extern "C" {
#define PRIxoff_t PRIx64
#define PRIdoff_t PRId64
#else
-#if (SIZEOF_LONG >= 8)
+#if (SIZEOF_LONG == SIZEOF_LOFF_T)
#define PRIxoff_t "l"PRIx32
#define PRIdoff_t "l"PRId32
#else