From: Mike Frysinger Date: Sun, 27 Nov 2016 03:52:00 +0000 (-0500) Subject: ptsname_r: leverage AC_HEADER_MAJOR X-Git-Tag: v1.0~6526 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=b799aee9aafabafa0b979d55d9716380167f4b49;p=gnulib.git ptsname_r: leverage AC_HEADER_MAJOR 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. --- diff --git a/ChangeLog b/ChangeLog index b2434b30c0..0db3da8ada 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2016-11-27 Mike Frysinger + + 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 md4,md5,sha*: allow _STRING_INLINE_unaligned enable unaligned operation diff --git a/lib/ptsname_r.c b/lib/ptsname_r.c index f4887bc97f..e0c634e20f 100644 --- a/lib/ptsname_r.c +++ b/lib/ptsname_r.c @@ -47,22 +47,26 @@ #endif +/* Get the major, minor macros. */ +#if MAJOR_IN_MKDEV +# include +#endif +#if MAJOR_IN_SYSMACROS +# include +#endif + #ifdef __sun /* Get ioctl() and 'struct strioctl'. */ # include /* Get ISPTM. */ # include # include -/* Get the major, minor macros. */ -# include # include #endif #if defined _AIX || defined __osf__ /* Get ioctl(), ISPTM. */ # include -/* Get the major, minor macros. */ -# include # include #endif diff --git a/m4/ptsname_r.m4 b/m4/ptsname_r.m4 index 4ddde81ee4..d71cac422a 100644 --- a/m4/ptsname_r.m4 +++ b/m4/ptsname_r.m4 @@ -42,6 +42,8 @@ AC_DEFUN([gl_FUNC_PTSNAME_R], REPLACE_PTSNAME_R=1 fi fi + + AC_REQUIRE([AC_HEADER_MAJOR]) ]) # Prerequisites of lib/ptsname.c.