Mercurial > gnulib
diff lib/ptsname_r.c @ 18532:93a8694eca79
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.
author | Mike Frysinger <vapier@gentoo.org> |
---|---|
date | Sat, 26 Nov 2016 22:52:00 -0500 |
parents | d9961cf477d9 |
children | 12df2165ec1c |
line wrap: on
line diff
--- a/lib/ptsname_r.c Sun Nov 27 00:23:14 2016 +0000 +++ b/lib/ptsname_r.c Sat Nov 26 22:52:00 2016 -0500 @@ -47,22 +47,26 @@ #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