Like the mountlist module, ptsname_r uses makedev/major/minor,
so use the existing autoconf macro which will probe some headers
for use and set up some defines.
* lib/ptsname_r.c: Likewise.
[__sun]: Delete sys/sysmacros.h include.
[_AIX || __osf__]: Likewise.
* m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): Depend on AC_HEADER_MAJOR.
+2016-11-27 Mike Frysinger <vapier@gentoo.org>
+
+ ptsname_r: leverage AC_HEADER_MAJOR to provide major()
+ * lib/ptsname_r.c: Include the appropriate headers.
+ [__sun]: Delete sys/sysmacros.h include.
+ [_AIX || __osf__]: Likewise.
+ * m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): Depend on AC_HEADER_MAJOR.
+
2016-11-27 Pádraig Brady <P@draigBrady.com>
md4,md5,sha*: allow _STRING_INLINE_unaligned enable unaligned operation
#endif
+/* Get the major, minor macros. */
+#if MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#endif
+#if MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif
+
#ifdef __sun
/* Get ioctl() and 'struct strioctl'. */
# include <stropts.h>
/* Get ISPTM. */
# include <sys/stream.h>
# include <sys/ptms.h>
-/* Get the major, minor macros. */
-# include <sys/sysmacros.h>
# include <stdio.h>
#endif
#if defined _AIX || defined __osf__
/* Get ioctl(), ISPTM. */
# include <sys/ioctl.h>
-/* Get the major, minor macros. */
-# include <sys/sysmacros.h>
# include <stdio.h>
#endif
REPLACE_PTSNAME_R=1
fi
fi
+
+ AC_REQUIRE([AC_HEADER_MAJOR])
])
# Prerequisites of lib/ptsname.c.