aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaveh Ghazi <ghazi@caip.rutgers.edu>2006-09-28 00:45:56 +0000
committerKaveh Ghazi <ghazi@caip.rutgers.edu>2006-09-28 00:45:56 +0000
commitadfebba05bbcd735ca25932ccfd080c635e53ce9 (patch)
treef87c109dd8d9657647a201bf9aa0cb1d671b42db
parenteed837b122da89e65567125950235dc6a3ca08b2 (diff)
* inclhack.def (solaris_once_init_2): New fix.
* tests/base/pthread.h: Update. * fixincl.x: Regenerate. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@117265 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--fixincludes/ChangeLog7
-rw-r--r--fixincludes/fixincl.x59
-rw-r--r--fixincludes/inclhack.def33
-rw-r--r--fixincludes/tests/base/pthread.h15
4 files changed, 109 insertions, 5 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index 4c311cf4a35..a0af51ceab2 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,5 +1,12 @@
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
PTHREAD_RWLOCK_INITIALIZER.
(solaris_rwlock_init_1): New.
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index cd1b3c5206b..742897e0be6 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -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.
*
@@ -5578,6 +5578,49 @@ static const char* apzSolaris_Once_Init_1Patch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * 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
*/
tSCC zSolaris_SocketName[] =
@@ -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,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 04e6aa1cc7f..f8d16643b0c 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -3034,6 +3034,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.
*/
diff --git a/fixincludes/tests/base/pthread.h b/fixincludes/tests/base/pthread.h
index 8b7f97b0b9c..5f6adf3b23b 100644
--- a/fixincludes/tests/base/pthread.h
+++ b/fixincludes/tests/base/pthread.h
@@ -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);