]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
inclhack.def (solaris_once_init_2): New fix.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Thu, 28 Sep 2006 00:45:56 +0000 (00:45 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Thu, 28 Sep 2006 00:45:56 +0000 (00:45 +0000)
* inclhack.def (solaris_once_init_2): New fix.
* tests/base/pthread.h: Update.

* fixincl.x: Regenerate.

From-SVN: r117265

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

index 4c311cf4a355182dce02980ada00b05ad787525f..a0af51ceab247b8f56e55401e66913c73759f8e0 100644 (file)
@@ -1,3 +1,10 @@
+2006-09-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * inclhack.def (solaris_once_init_2): New fix.
+       * tests/base/pthread.h: Update.
+
+       * fixincl.x: Regenerate.
+
 2006-09-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * inclhack.def (solaris_mutex_init_2): Remove test for
index cd1b3c5206bab36ecf644931c9d7d9d6457c3096..742897e0be69bc27a897cb38ad220524f3dcd1e7 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Tuesday September 26, 2006 at 11:56:29 AM EDT
+ * It has been AutoGen-ed  Wednesday September 27, 2006 at 08:16:42 PM EDT
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT CVS-MERGE THIS FILE, EITHER Tue Sep 26 11:56:29 EDT 2006
+/* DO NOT CVS-MERGE THIS FILE, EITHER Wed Sep 27 20:16:42 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 198 fixup descriptions.
+ * This file contains 199 fixup descriptions.
  *
  * See README for more information.
  *
@@ -5576,6 +5576,49 @@ static const char* apzSolaris_Once_Init_1Patch[] = {
     "(^#define[ \t]+PTHREAD_ONCE_INIT[ \t]+\\{)([^}]+)(\\})[ \t]*$",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Solaris_Once_Init_2 fix
+ */
+tSCC zSolaris_Once_Init_2Name[] =
+     "solaris_once_init_2";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zSolaris_Once_Init_2List[] =
+  "|pthread.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzSolaris_Once_Init_2Machs[] = {
+        "*-*-solaris2.[0-9]",
+        "*-*-solaris2.[0-9][!0-9]*",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_Once_Init_2Select0[] =
+       "@\\(#\\)pthread.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+
+#define    SOLARIS_ONCE_INIT_2_TEST_CT  1
+static tTestDesc aSolaris_Once_Init_2Tests[] = {
+  { TT_EGREP,    zSolaris_Once_Init_2Select0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Solaris_Once_Init_2
+ */
+static const char* apzSolaris_Once_Init_2Patch[] = {
+    "format",
+    "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n\
+%0\n\
+#else\n\
+%1{0}, {0}, {0}, {%3}%4\n\
+#endif",
+    "(^#define[ \t]+PTHREAD_ONCE_INIT[ \t]+\\{\\{)(0, 0, 0, )(PTHREAD_[A-Z_]+)(\\}\\})[ \t]*$",
+    (char*)NULL };
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
  *  Description of Solaris_Socket fix
@@ -8057,9 +8100,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          241
+#define REGEX_COUNT          242
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT            198
+#define FIX_COUNT            199
 
 /*
  *  Enumerate the fixes
@@ -8200,6 +8243,7 @@ typedef enum {
     SOLARIS_MUTEX_INIT_2_FIXIDX,
     SOLARIS_RWLOCK_INIT_1_FIXIDX,
     SOLARIS_ONCE_INIT_1_FIXIDX,
+    SOLARIS_ONCE_INIT_2_FIXIDX,
     SOLARIS_SOCKET_FIXIDX,
     SOLARIS_STDIO_TAG_FIXIDX,
     SOLARIS_UNISTD_FIXIDX,
@@ -8941,6 +8985,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      SOLARIS_ONCE_INIT_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aSolaris_Once_Init_1Tests,   apzSolaris_Once_Init_1Patch, 0 },
 
+  {  zSolaris_Once_Init_2Name,    zSolaris_Once_Init_2List,
+     apzSolaris_Once_Init_2Machs,
+     SOLARIS_ONCE_INIT_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aSolaris_Once_Init_2Tests,   apzSolaris_Once_Init_2Patch, 0 },
+
   {  zSolaris_SocketName,    zSolaris_SocketList,
      apzSolaris_SocketMachs,
      SOLARIS_SOCKET_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
index 04e6aa1cc7f8dd5f27356c9aeea32ca54001e309..f8d16643b0cfcd61c89b7de9f6cbaecdabf51f30 100644 (file)
@@ -3033,6 +3033,39 @@ fix = {
 };
 
 
+/*
+ * Sun Solaris defines PTHREAD_ONCE_INIT with a "0" for some
+ *  fields of the pthread_once_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.  This test relies on solaris_once_init_1.
+ */
+fix = {
+    hackname = solaris_once_init_2;
+    select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+    files = pthread.h;
+    /*
+     * On Solaris 10, this fix is unnecessary because upad64_t is
+     * always defined correctly regardless of the definition of the
+     * __STDC__ macro.  The first "match" pattern matches up to
+     * solaris9.  The second "mach" pattern will not match any two (or
+     * more) digit solaris version, but it will match e.g. 2.5.1.
+     */
+    mach = '*-*-solaris2.[0-9]', '*-*-solaris2.[0-9][!0-9]*';
+    c_fix = format;
+    c_fix_arg = "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n"
+                "%0\n"
+                "#else\n"
+                "%1{0}, {0}, {0}, {%3}%4\n"
+                "#endif";
+    c_fix_arg = "(^#define[ \t]+PTHREAD_ONCE_INIT[ \t]+\\{\\{)"
+                "(0, 0, 0, )(PTHREAD_[A-Z_]+)(\\}\\})[ \t]*$";
+    test_text =
+    '#ident "@(#)pthread.h  1.26  98/04/12 SMI"'"\n"
+    "#define PTHREAD_ONCE_INIT\t{{0, 0, 0, PTHREAD_ONCE_NOTDONE}}\n";
+};
+
+
 /*
  * Solaris 2.5.1 and 2.6 use an outdated prototype for send & recv
  * in sys/socket.h.  This is corrected in Solaris 7 and up.
index 8b7f97b0b9c3d16d6e00086e5acd8c1d7094e341..5f6adf3b23b6d5a82260b461c67fabdc62a12548 100644 (file)
@@ -109,10 +109,25 @@ extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask);
 
 #if defined( SOLARIS_ONCE_INIT_1_CHECK )
 #pragma ident  "@(#)pthread.h  1.37    04/09/28 SMI"
+#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
 #define PTHREAD_ONCE_INIT      {{0, 0, 0, PTHREAD_ONCE_NOTDONE}}
+#else
+#define PTHREAD_ONCE_INIT      {{{0}, {0}, {0}, {PTHREAD_ONCE_NOTDONE}}}
+#endif
 #endif  /* SOLARIS_ONCE_INIT_1_CHECK */
 
 
+#if defined( SOLARIS_ONCE_INIT_2_CHECK )
+#ident "@(#)pthread.h  1.26  98/04/12 SMI"
+#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
+#define PTHREAD_ONCE_INIT      {{0, 0, 0, PTHREAD_ONCE_NOTDONE}}
+#else
+#define PTHREAD_ONCE_INIT      {{{0}, {0}, {0}, {PTHREAD_ONCE_NOTDONE}}}
+#endif
+
+#endif  /* SOLARIS_ONCE_INIT_2_CHECK */
+
+
 #if defined( THREAD_KEYWORD_CHECK )
 extern int pthread_create (pthread_t *__restrict __thr,
 extern int pthread_kill (pthread_t __thr, int __signo);