From: Kaveh R. Ghazi Date: Wed, 27 Sep 2006 04:59:56 +0000 (+0000) Subject: inclhack.def (solaris_mutex_init_2): Remove test for PTHREAD_RWLOCK_INITIALIZER. X-Git-Tag: releases/gcc-4.0.4~335 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35daab5fc97828eb53324b42387f14bfa1e4a316;p=thirdparty%2Fgcc.git inclhack.def (solaris_mutex_init_2): Remove test for PTHREAD_RWLOCK_INITIALIZER. * 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. From-SVN: r117246 --- diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index a84a524b9e61..b409ae43764a 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,15 @@ +2006-09-27 Kaveh R. Ghazi + + * 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-03-16 Steve Ellcey PR target/26189 diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index 29d63ff763cb..ac2fbfaa00f2 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 March 16, 2006 at 02:01:05 PM PST + * It has been AutoGen-ed Wednesday September 27, 2006 at 12:38:32 AM EDT * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT CVS-MERGE THIS FILE, EITHER Thu Mar 16 14:01:05 PST 2006 +/* DO NOT CVS-MERGE THIS FILE, EITHER Wed Sep 27 00:38:32 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 192 fixup descriptions. + * This file contains 194 fixup descriptions. * * See README for more information. * @@ -5258,6 +5258,86 @@ static const char* apzSolaris_Mutex_Init_2Patch[] = { "(^#define[ \t]+PTHREAD_(MUTEX|COND)_INITIALIZER[ \t]+\\{.*),[ \t]*0\\}(|[ \t].*)$", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * 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 @@ -7739,9 +7819,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 234 +#define REGEX_COUNT 236 #define MACH_LIST_SIZE_LIMIT 261 -#define FIX_COUNT 192 +#define FIX_COUNT 194 /* * Enumerate the fixes @@ -7876,6 +7956,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, @@ -8587,6 +8669,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 68d5b1f9ca31..0bc95c2cc82e 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -2845,9 +2845,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 9998f660c7cb..8b7f97b0b9c3 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);