In a recent update, libstdc++ started using the pthread_rwlock struct.  This 
exposed a c++ error in
the definition of __LWP_RWLOCK_VALID.  It is an error to initialize a short 
field with the constant
0x8c91.

The attached change changes the __LWP_RWLOCK_VALID value to -29551.

Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.  Committed to trunk.

Dave
--
John David Anglin       dave.ang...@bell.net


2015-03-28  John David Anglin  <dang...@gcc.gnu.org>

        PR libstdc++/65500
        * inclhack.def (hpux11_lwp_rwlock_valid): New fix.
        * fixincl.x: Regenerate.
        * tests/base/sys/pthread.h [HPUX11_LWP_RWLOCK_VALID_CHECK]: New test.

Index: inclhack.def
===================================================================
--- inclhack.def        (revision 221591)
+++ inclhack.def        (working copy)
@@ -2074,6 +2074,19 @@
 };
 
 /*
+ *  Fix hpux11 __LWP_RWLOCK_VALID define
+ */
+fix = {
+    hackname  = hpux11_lwp_rwlock_valid;
+    mach      = "*-hp-hpux11*";
+    files     = sys/pthread.h;
+    select    = "#define __LWP_RWLOCK_VALID[ \t]*0x8c91";
+    c_fix     = format;
+    c_fix_arg = "#define __LWP_RWLOCK_VALID              -29551";
+    test_text = "#define __LWP_RWLOCK_VALID 0x8c91";
+};
+
+/*
  * hpux sendfile()
  */
 fix = {
Index: tests/base/sys/pthread.h
===================================================================
--- tests/base/sys/pthread.h    (revision 221591)
+++ tests/base/sys/pthread.h    (working copy)
@@ -9,6 +9,11 @@
 
 
 
+#if defined( HPUX11_LWP_RWLOCK_VALID_CHECK )
+#define __LWP_RWLOCK_VALID              -29551
+#endif  /* HPUX11_LWP_RWLOCK_VALID_CHECK */
+
+
 #if defined( HPUX11_PTHREAD_CONST_CHECK )
 #define __POINTER_SET          ((void *) 1L)
 #endif  /* HPUX11_PTHREAD_CONST_CHECK */

Reply via email to