summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-27 04:25:34 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-27 04:25:34 +0000
commit458caa241dc32254a638b0306465d91835864c86 (patch)
tree42a64537c4a224b5d30ca4f1b8fd71c927c48937
parent90f9030c047668845e32895e4eb05c705ec84233 (diff)
downloadgcc-458caa241dc32254a638b0306465d91835864c86.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117244 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--fixincludes/ChangeLog12
-rw-r--r--fixincludes/fixincl.x102
-rw-r--r--fixincludes/inclhack.def50
-rw-r--r--fixincludes/tests/base/pthread.h17
4 files changed, 172 insertions, 9 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index 3db9210599e..4c311cf4a35 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -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.
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index 9b2a10c9b5c..cd1b3c5206b 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 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,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index c4a689301b8..04e6aa1cc7f 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -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}";
};
diff --git a/fixincludes/tests/base/pthread.h b/fixincludes/tests/base/pthread.h
index 9998f660c7c..8b7f97b0b9c 100644
--- a/fixincludes/tests/base/pthread.h
+++ b/fixincludes/tests/base/pthread.h
@@ -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);