]> Savannah Git Hosting - gnulib.git/commitdiff
ptsname_r: leverage AC_HEADER_MAJOR
authorMike Frysinger <vapier@gentoo.org>
Sun, 27 Nov 2016 03:52:00 +0000 (22:52 -0500)
committerPádraig Brady <P@draigBrady.com>
Sun, 27 Nov 2016 11:38:58 +0000 (11:38 +0000)
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.

ChangeLog
lib/ptsname_r.c
m4/ptsname_r.m4

index b2434b30c0a30e7d83ecb06084d672765cce6eff..0db3da8ada84952e0dd6ac3be798c8cccbd3c293 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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
index f4887bc97fb9c75bb96955716aecc14ac19be9fa..e0c634e20f7c53d4117952da9f252ecd1502817f 100644 (file)
 
 #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
 
index 4ddde81ee4874ffa0f043794006cf3a4e7155117..d71cac422aff54006ca14ab297cd41889919d365 100644 (file)
@@ -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.