OSDN Git Service

* inclhack.def (solaris_mutex_init_2): Remove test for
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Sep 2006 04:25:34 +0000 (04:25 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Sep 2006 04:25:34 +0000 (04:25 +0000)
PTHREAD_RWLOCK_INITIALIZER.
(solaris_rwlock_init_1): New.
* tests/base/pthread.h: Update.

* inclhack.def (solaris_once_init_1): New.
* tests/base/pthread.h: Adjust for new fix.

* fixincl.x: Regenerate.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117244 138bc75d-0d04-0410-961f-82ee72b054a4

fixincludes/ChangeLog
fixincludes/fixincl.x
fixincludes/inclhack.def
fixincludes/tests/base/pthread.h

index 3db9210..4c311cf 100644 (file)
@@ -1,3 +1,15 @@
+2006-09-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * inclhack.def (solaris_mutex_init_2): Remove test for
+       PTHREAD_RWLOCK_INITIALIZER.
+       (solaris_rwlock_init_1): New.
+       * tests/base/pthread.h: Update.
+
+       * inclhack.def (solaris_once_init_1): New.
+       * tests/base/pthread.h: Adjust for new fix.
+       
+       * fixincl.x: Regenerate.
+
 2006-07-17  Roger Sayle  <roger@eyesopen.com>
 
        * tests/base/errno.h: New file.
index 9b2a10c..cd1b3c5 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Thursday June 22, 2006 at 03:07:03 PM PDT
+ * It has been AutoGen-ed  Tuesday September 26, 2006 at 11:56:29 AM EDT
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT CVS-MERGE THIS FILE, EITHER Thu Jun 22 15:07:03 PDT 2006
+/* DO NOT CVS-MERGE THIS FILE, EITHER Tue Sep 26 11:56:29 EDT 2006
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -15,7 +15,7 @@
  * certain ANSI-incompatible system header files which are fixed to work
  * correctly with ANSI C and placed in a directory that GNU C will search.
  *
- * This file contains 196 fixup descriptions.
+ * This file contains 198 fixup descriptions.
  *
  * See README for more information.
  *
@@ -5498,6 +5498,86 @@ static const char* apzSolaris_Mutex_Init_2Patch[] = {
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
+ *  Description of Solaris_Rwlock_Init_1 fix
+ */
+tSCC zSolaris_Rwlock_Init_1Name[] =
+     "solaris_rwlock_init_1";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zSolaris_Rwlock_Init_1List[] =
+  "|pthread.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzSolaris_Rwlock_Init_1Machs[] = {
+        "*-*-solaris*",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_Rwlock_Init_1Select0[] =
+       "@\\(#\\)pthread.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+
+#define    SOLARIS_RWLOCK_INIT_1_TEST_CT  1
+static tTestDesc aSolaris_Rwlock_Init_1Tests[] = {
+  { TT_EGREP,    zSolaris_Rwlock_Init_1Select0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Solaris_Rwlock_Init_1
+ */
+static const char* apzSolaris_Rwlock_Init_1Patch[] = {
+    "format",
+    "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n\
+%0\n\
+#else\n\
+%1{0, 0, 0, {{0}, {0}, {0}}, {{0}, {0}}, {{0}, {0}}}\n\
+#endif",
+    "(^#define[ \t]+PTHREAD_RWLOCK_INITIALIZER[ \t]+)\\{0, 0, 0, \\{0, 0, 0\\}, \\{0, 0\\}, \\{0, 0\\}\\}[ \t]*$",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Solaris_Once_Init_1 fix
+ */
+tSCC zSolaris_Once_Init_1Name[] =
+     "solaris_once_init_1";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zSolaris_Once_Init_1List[] =
+  "|pthread.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzSolaris_Once_Init_1Machs[] = {
+        "*-*-solaris*",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_Once_Init_1Select0[] =
+       "@\\(#\\)pthread.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+
+#define    SOLARIS_ONCE_INIT_1_TEST_CT  1
+static tTestDesc aSolaris_Once_Init_1Tests[] = {
+  { TT_EGREP,    zSolaris_Once_Init_1Select0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Solaris_Once_Init_1
+ */
+static const char* apzSolaris_Once_Init_1Patch[] = {
+    "format",
+    "%1{%2}%3",
+    "(^#define[ \t]+PTHREAD_ONCE_INIT[ \t]+\\{)([^}]+)(\\})[ \t]*$",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
  *  Description of Solaris_Socket fix
  */
 tSCC zSolaris_SocketName[] =
@@ -7977,9 +8057,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          239
+#define REGEX_COUNT          241
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT            196
+#define FIX_COUNT            198
 
 /*
  *  Enumerate the fixes
@@ -8118,6 +8198,8 @@ typedef enum {
     SOLARIS_MATH_9_FIXIDX,
     SOLARIS_MUTEX_INIT_1_FIXIDX,
     SOLARIS_MUTEX_INIT_2_FIXIDX,
+    SOLARIS_RWLOCK_INIT_1_FIXIDX,
+    SOLARIS_ONCE_INIT_1_FIXIDX,
     SOLARIS_SOCKET_FIXIDX,
     SOLARIS_STDIO_TAG_FIXIDX,
     SOLARIS_UNISTD_FIXIDX,
@@ -8849,6 +8931,16 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      SOLARIS_MUTEX_INIT_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aSolaris_Mutex_Init_2Tests,   apzSolaris_Mutex_Init_2Patch, 0 },
 
+  {  zSolaris_Rwlock_Init_1Name,    zSolaris_Rwlock_Init_1List,
+     apzSolaris_Rwlock_Init_1Machs,
+     SOLARIS_RWLOCK_INIT_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aSolaris_Rwlock_Init_1Tests,   apzSolaris_Rwlock_Init_1Patch, 0 },
+
+  {  zSolaris_Once_Init_1Name,    zSolaris_Once_Init_1List,
+     apzSolaris_Once_Init_1Machs,
+     SOLARIS_ONCE_INIT_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aSolaris_Once_Init_1Tests,   apzSolaris_Once_Init_1Patch, 0 },
+
   {  zSolaris_SocketName,    zSolaris_SocketList,
      apzSolaris_SocketMachs,
      SOLARIS_SOCKET_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
index c4a6893..04e6aa1 100644 (file)
@@ -2983,9 +2983,53 @@ fix = {
     test_text =
     '#ident "@(#)pthread.h  1.26  98/04/12 SMI"'"\n"
     "#define PTHREAD_MUTEX_INITIALIZER\t{{{0},0}, {{{0}}}, 0}\n"
-    "#define PTHREAD_COND_INITIALIZER\t{{{0}, 0}, 0}\t/* DEFAULTCV */\n"
-    "#define PTHREAD_RWLOCK_INITIALIZER\t"
-             "{0, 0, 0, {0, 0, 0}, {0, 0}, {0, 0}}";
+    "#define PTHREAD_COND_INITIALIZER\t{{{0}, 0}, 0}\t/* DEFAULTCV */";
+};
+
+
+/*
+ * Sun Solaris defines PTHREAD_RWLOCK_INITIALIZER with a "0" for some
+ *  fields of the pthread_rwlock_t structure, which are of type
+ *  upad64_t, which itself is typedef'd to int64_t, but with __STDC__
+ *  defined (e.g. by -ansi) it is a union. So change the initializer
+ *  to "{0}" instead.
+ */
+fix = {
+    hackname = solaris_rwlock_init_1;
+    select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+    files = pthread.h;
+    mach = '*-*-solaris*';
+    c_fix = format;
+    c_fix_arg = "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n"
+                "%0\n"
+                "#else\n"
+                "%1{0, 0, 0, {{0}, {0}, {0}}, {{0}, {0}}, {{0}, {0}}}\n"
+                "#endif";
+    c_fix_arg = "(^#define[ \t]+PTHREAD_RWLOCK_INITIALIZER[ \t]+)"
+                "\\{0, 0, 0, \\{0, 0, 0\\}, \\{0, 0\\}, \\{0, 0\\}\\}[ \t]*$";
+
+    test_text =
+    '#ident "@(#)pthread.h  1.26  98/04/12 SMI"'"\n"
+    "#define PTHREAD_RWLOCK_INITIALIZER\t{0, 0, 0, {0, 0, 0}, {0, 0}, {0, 0}}";
+};
+
+
+/*
+ * Sun Solaris defines PTHREAD_ONCE_INIT as an array containing a
+ * structure.  As such, it need two levels of brackets, but only
+ * contains one.  Wrap the macro definition in an extra layer.
+ */
+fix = {
+    hackname = solaris_once_init_1;
+    select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+    files = pthread.h;
+    mach = '*-*-solaris*';
+    c_fix = format;
+    c_fix_arg = "%1{%2}%3";
+    c_fix_arg = "(^#define[ \t]+PTHREAD_ONCE_INIT[ \t]+\\{)([^}]+)(\\})[ \t]*$";
+    test_text =
+    '#pragma ident     "@(#)pthread.h  1.37    04/09/28 SMI"'"\n"
+    "#define PTHREAD_ONCE_INIT\t{0, 0, 0, PTHREAD_ONCE_NOTDONE}";
 };
 
 
index 9998f66..8b7f97b 100644 (file)
@@ -94,10 +94,25 @@ extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask);
 #else
 #define PTHREAD_COND_INITIALIZER       {{{0}, 0}, {0}} /* DEFAULTCV */
 #endif
-#define PTHREAD_RWLOCK_INITIALIZER     {0, 0, 0, {0, 0, 0}, {0, 0}, {0, 0}}
 #endif  /* SOLARIS_MUTEX_INIT_2_CHECK */
 
 
+#if defined( SOLARIS_RWLOCK_INIT_1_CHECK )
+#ident "@(#)pthread.h  1.26  98/04/12 SMI"
+#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
+#define PTHREAD_RWLOCK_INITIALIZER     {0, 0, 0, {0, 0, 0}, {0, 0}, {0, 0}}
+#else
+#define PTHREAD_RWLOCK_INITIALIZER     {0, 0, 0, {{0}, {0}, {0}}, {{0}, {0}}, {{0}, {0}}}
+#endif
+#endif  /* SOLARIS_RWLOCK_INIT_1_CHECK */
+
+
+#if defined( SOLARIS_ONCE_INIT_1_CHECK )
+#pragma ident  "@(#)pthread.h  1.37    04/09/28 SMI"
+#define PTHREAD_ONCE_INIT      {{0, 0, 0, PTHREAD_ONCE_NOTDONE}}
+#endif  /* SOLARIS_ONCE_INIT_1_CHECK */
+
+
 #if defined( THREAD_KEYWORD_CHECK )
 extern int pthread_create (pthread_t *__restrict __thr,
 extern int pthread_kill (pthread_t __thr, int __signo);