Skip to content

Commit

Permalink
Use AC_HEADER_MAJOR to find definitions of major, minor, makedev.
Browse files Browse the repository at this point in the history
Note this requires either the following fix in autoconf:

http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98

OR gnulib sys_types module plus gnulib
commit a512e041120e9012e69afa2f5c3adc196ec4999a (any gnulib more
recent than Sep 2016) which corrects the AC_HEADER_MAJOR macro in a
similar way.
  • Loading branch information
rwmjones committed Mar 1, 2017
1 parent 2383264 commit 3d62e1f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions configure.ac
Expand Up @@ -42,6 +42,9 @@ AC_SYS_LARGEFILE
dnl Enable GNU stuff.
AC_USE_SYSTEM_EXTENSIONS

dnl Which header file defines major, minor, makedev.
AC_HEADER_MAJOR

dnl Define the host CPU architecture (defines host_cpu).
AC_CANONICAL_HOST

Expand Down
6 changes: 6 additions & 0 deletions init/init.c
Expand Up @@ -40,7 +40,13 @@
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/wait.h>

#if MAJOR_IN_MKDEV
#include <sys/mkdev.h>
#elif MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
/* else it's in sys/types.h, included above */
#endif

/* Maximum time to wait for the root device to appear (seconds).
*
Expand Down
1 change: 1 addition & 0 deletions m4/gnulib-cache.m4
Expand Up @@ -33,6 +33,7 @@
gl_LOCAL_DIR([])
gl_MODULES([
fts
sys_types
])
gl_AVOID([])
gl_SOURCE_BASE([lib])
Expand Down
6 changes: 6 additions & 0 deletions src/ext2fs-c.c
Expand Up @@ -32,7 +32,13 @@
#include <errno.h>
#include <assert.h>
#include <inttypes.h>

#if MAJOR_IN_MKDEV
#include <sys/mkdev.h>
#elif MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
/* else it's in sys/types.h, included above */
#endif

/* Inlining is broken in the ext2fs header file. Disable it by
* defining the following:
Expand Down

0 comments on commit 3d62e1f

Please sign in to comment.