<div dir="ltr">This patch is dropped, due to Martin's 8b9cda51f5c64bc869188ca0b2e1ac0e7eb7c667 patch switching to sys/sysmacros.h<div><br></div><div>Otherwise, the rest of the set is now merged.</div><div>Thanks.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 17, 2017 at 5:43 PM, Bart Van Assche <span dir="ltr"><<a href="mailto:bart.vanassche@sandisk.com" target="_blank">bart.vanassche@sandisk.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Avoid that building against glibc >= 2.25 triggers the following<br>
compiler warning:<br>
<br>
lopart.c: In function 'is_loop_device':<br>
lopart.c:93:13: warning: In the GNU C Library, "major" is defined<br>
 by <sys/sysmacros.h>. For historical compatibility, it is<br>
 currently defined by <sys/types.h> as well, but we plan to<br>
 remove this soon. To use "major", include <sys/sysmacros.h><br>
 directly. If you did not intend to use a system-defined macro<br>
 "major", you should undefine it after including <sys/types.h>.<br>
   major(statbuf.st_rdev) == loopmajor);<br>
<br>
Signed-off-by: Bart Van Assche <<a href="mailto:bart.vanassche@sandisk.com">bart.vanassche@sandisk.com</a>><br>
---<br>
 kpartx/Makefile    | 4 ++++<br>
 kpartx/sysmacros.h | 6 ++++++<br>
 2 files changed, 10 insertions(+)<br>
<br>
diff --git a/kpartx/Makefile b/kpartx/Makefile<br>
index 9441a2ba..2d2a249e 100644<br>
--- a/kpartx/Makefile<br>
+++ b/kpartx/Makefile<br>
@@ -10,6 +10,10 @@ LIBDEPS += -ldevmapper<br>
 ifneq ($(call check_func,dm_task_set_cookie,<wbr>/usr/include/libdevmapper.h),<wbr>0)<br>
        CFLAGS += -DLIBDM_API_COOKIE<br>
 endif<br>
+ifneq ($(call check_func,major,/usr/include/<wbr>sys/sysmacros.h),0)<br>
+       CFLAGS += -DHAVE_SYS_SYSMACROS_H<br>
+endif<br>
+<br>
<br>
 OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \<br>
        gpt.o mac.o ps3.o crc32.o lopart.o xstrncpy.o devmapper.o<br>
diff --git a/kpartx/sysmacros.h b/kpartx/sysmacros.h<br>
index 171b33d4..dc5077ec 100644<br>
--- a/kpartx/sysmacros.h<br>
+++ b/kpartx/sysmacros.h<br>
@@ -1,5 +1,10 @@<br>
 /* versions to be used with > 16-bit dev_t - leave unused for now */<br>
<br>
+#ifdef HAVE_SYS_SYSMACROS_H<br>
+#include <sys/sysmacros.h><br>
+#else<br>
+#include <sys/types.h><br>
+<br>
 #ifndef major<br>
 #define major(dev)     ((dev) >> 8)<br>
 #endif<br>
@@ -7,3 +12,4 @@<br>
 #ifndef minor<br>
 #define minor(dev)     ((dev) & 0xff)<br>
 #endif<br>
+#endif<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.12.2<br>
<br>
</font></span></blockquote></div><br></div>