* m4/readutmp.m4 (gl_READUTMP): Work around AIX 4.3 struct-
authorJim Meyering <jim@meyering.net>
Tue, 16 Jan 2007 09:40:30 +0000 (09:40 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 16 Jan 2007 09:40:30 +0000 (09:40 +0000)
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>.

ChangeLog
lib/readutmp.h
m4/readutmp.m4

index dfae5c620e36ed92225683881a27bef0d88c7562..113f9b72f33a4ba5a767c429e24ce60d32445f04 100644 (file)
--- 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.
index dd2efbb44868dc93301c4596480514149a891542..84cf117924d45996e50f2f53ccdbe1757efe7232 100644 (file)
@@ -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
     /* 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)
index 33ed4e848a022905fd5a9654fe9c8342bab52236..2e520cd70cae0aa78022812896f629c086314b18 100644 (file)
@@ -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 @@ $ac_includes_default
 # 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
 "