]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
blkid: fix building e2fsprogs with internal libblkid
authorEric Biggers <ebiggers@google.com>
Fri, 2 Mar 2018 05:21:35 +0000 (21:21 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 2 Mar 2018 21:31:16 +0000 (16:31 -0500)
Building e2fsprogs with the internal libblkid fails for me with the
following compiler error:

In file included from blkidP.h:27:0,
 from dev.c:17:
dev.c: In function ‘blkid_free_dev’:
../../lib/blkid/list.h:149:42: error: ‘intptr_t’ undeclared (first use in this function); did you mean ‘__intptr_t’?
  ((type *)((char *)(ptr)-(unsigned long)(intptr_t)(&((type *)0)->member)))

The problem is that lib/blkid/list.h is now using 'intptr_t', but
stdint.h is not guaranteed to have been included yet.  Include it.

[ Changed to use inttypes.h if it is available and fall back to stdint.h
  if it is not available - tytso ]

Fixes: 0a3d8041892c ("AOSP: build mke2fs for windows using android mingw library")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/blkid/list.h

index 26a5ac1b4cb58afe21e86555119685cbad5bf8c2..3e96dd803518060a2f591cdcde18772dc9468f6a 100644 (file)
@@ -5,6 +5,14 @@
 extern "C" {
 #endif
 
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#else
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#endif
+
 #ifdef __GNUC__
 #define _INLINE_ static __inline__
 #else                         /* For Watcom C */