changeset 7884:2a056686c032

* m4/readutmp.m4 (gl_READUTMP): Work around AIX 4.3 struct- redefinition bug when using both <utmp.h> and <utmpx.h> headers. * lib/readutmp.h: Likewise. Reported by Daniel Richard G. in <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/9415>.
author Jim Meyering <jim@meyering.net>
date Tue, 16 Jan 2007 09:40:30 +0000
parents e590ba9dd9c2
children fe5267a63384
files ChangeLog lib/readutmp.h m4/readutmp.m4
diffstat 3 files changed, 20 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-01-15  Jim Meyering  <jim@meyering.net>
+
+	* m4/readutmp.m4 (gl_READUTMP): Work around AIX 4.3 struct-
+	redefinition bug when using both <utmp.h> and <utmpx.h> headers.
+	* lib/readutmp.h: Likewise.  Reported by Daniel Richard G. in
+	<http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/9415>.
+
 2007-01-15  Bruno Haible  <bruno@clisp.org>
 
 	* modules/striconveh: New file.
--- a/lib/readutmp.h
+++ b/lib/readutmp.h
@@ -1,7 +1,6 @@
 /* Declarations for GNU's read utmp module.
 
-   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1992-2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -36,6 +35,11 @@
     /* HPUX 10.20 needs utmp.h, for the definition of e.g., UTMP_FILE.  */
 #   include <utmp.h>
 #  endif
+#  if defined _THREAD_SAFE && defined UTMP_DATA_INIT
+    /* When including both utmp.h and utmpx.h on AIX 4.3, with _THREAD_SAFE
+       defined, work around the duplicate struct utmp_data declaration.  */
+#   define utmp_data gl_aix_4_3_workaround_utmp_data
+#  endif
 #  include <utmpx.h>
 #  define UTMP_STRUCT_NAME utmpx
 #  define UT_TIME_MEMBER(UT_PTR) ((UT_PTR)->ut_tv.tv_sec)
--- a/m4/readutmp.m4
+++ b/m4/readutmp.m4
@@ -1,5 +1,5 @@
-# readutmp.m4 serial 12
-dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# readutmp.m4 serial 13
+dnl Copyright (C) 2002-2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -28,6 +28,11 @@
 # include <utmpx.h>
 #endif
 #ifdef HAVE_UTMP_H
+# if defined _THREAD_SAFE && defined UTMP_DATA_INIT
+   /* When including both utmp.h and utmpx.h on AIX 4.3, with _THREAD_SAFE
+      defined, work around the duplicate struct utmp_data declaration.  */
+#  define utmp_data gl_aix_4_3_workaround_utmp_data
+# endif
 # include <utmp.h>
 #endif
 "