Commit 0a1f02df by Kaveh R. Ghazi Committed by Kaveh Ghazi

inclhack.def (solaris_once_init_2): New fix.

	* inclhack.def (solaris_once_init_2): New fix.
	* tests/base/pthread.h: Update.

	* fixincl.x: Regenerate.

From-SVN: r117265
parent fe2c3afc
2006-09-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 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 * inclhack.def (solaris_mutex_init_2): Remove test for
PTHREAD_RWLOCK_INITIALIZER. PTHREAD_RWLOCK_INITIALIZER.
(solaris_rwlock_init_1): New. (solaris_rwlock_init_1): New.
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* *
* DO NOT EDIT THIS FILE (fixincl.x) * 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 * From the definitions inclhack.def
* and the template file fixincl * 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. * You must regenerate it. Use the ./genfixes script.
* *
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work * 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. * 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. * See README for more information.
* *
...@@ -5578,6 +5578,49 @@ static const char* apzSolaris_Once_Init_1Patch[] = { ...@@ -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 * Description of Solaris_Socket fix
*/ */
tSCC zSolaris_SocketName[] = tSCC zSolaris_SocketName[] =
...@@ -8057,9 +8100,9 @@ static const char* apzX11_SprintfPatch[] = { ...@@ -8057,9 +8100,9 @@ static const char* apzX11_SprintfPatch[] = {
* *
* List of all fixes * List of all fixes
*/ */
#define REGEX_COUNT 241 #define REGEX_COUNT 242
#define MACH_LIST_SIZE_LIMIT 261 #define MACH_LIST_SIZE_LIMIT 261
#define FIX_COUNT 198 #define FIX_COUNT 199
/* /*
* Enumerate the fixes * Enumerate the fixes
...@@ -8200,6 +8243,7 @@ typedef enum { ...@@ -8200,6 +8243,7 @@ typedef enum {
SOLARIS_MUTEX_INIT_2_FIXIDX, SOLARIS_MUTEX_INIT_2_FIXIDX,
SOLARIS_RWLOCK_INIT_1_FIXIDX, SOLARIS_RWLOCK_INIT_1_FIXIDX,
SOLARIS_ONCE_INIT_1_FIXIDX, SOLARIS_ONCE_INIT_1_FIXIDX,
SOLARIS_ONCE_INIT_2_FIXIDX,
SOLARIS_SOCKET_FIXIDX, SOLARIS_SOCKET_FIXIDX,
SOLARIS_STDIO_TAG_FIXIDX, SOLARIS_STDIO_TAG_FIXIDX,
SOLARIS_UNISTD_FIXIDX, SOLARIS_UNISTD_FIXIDX,
...@@ -8941,6 +8985,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { ...@@ -8941,6 +8985,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
SOLARIS_ONCE_INIT_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, SOLARIS_ONCE_INIT_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSolaris_Once_Init_1Tests, apzSolaris_Once_Init_1Patch, 0 }, 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, { zSolaris_SocketName, zSolaris_SocketList,
apzSolaris_SocketMachs, apzSolaris_SocketMachs,
SOLARIS_SOCKET_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, SOLARIS_SOCKET_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
......
...@@ -3034,6 +3034,39 @@ fix = { ...@@ -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 * 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. * in sys/socket.h. This is corrected in Solaris 7 and up.
*/ */
......
...@@ -109,10 +109,25 @@ extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask); ...@@ -109,10 +109,25 @@ extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask);
#if defined( SOLARIS_ONCE_INIT_1_CHECK ) #if defined( SOLARIS_ONCE_INIT_1_CHECK )
#pragma ident "@(#)pthread.h 1.37 04/09/28 SMI" #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}} #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 */ #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 ) #if defined( THREAD_KEYWORD_CHECK )
extern int pthread_create (pthread_t *__restrict __thr, extern int pthread_create (pthread_t *__restrict __thr,
extern int pthread_kill (pthread_t __thr, int __signo); extern int pthread_kill (pthread_t __thr, int __signo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment