diff options
author | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-03 05:52:05 +0000 |
---|---|---|
committer | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-03 05:52:05 +0000 |
commit | d0f017a14270a48eb1d3f06a771ab7b885e8cff3 (patch) | |
tree | 00c426b2364c9235ae1659b9df36e06c02cd0647 /fixincludes | |
parent | 58a123f271071d01cba925a44d72f5953cb841ae (diff) | |
download | gcc-d0f017a14270a48eb1d3f06a771ab7b885e8cff3.tar.gz |
* inclhack.def (glibc_mutex_init): Also fix
PTHREAD_MUTEX_(RECURSIVE|ERRORCHECK|ADAPTIVE)_NP and
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP initializers.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117386 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fixincludes')
-rw-r--r-- | fixincludes/ChangeLog | 12 | ||||
-rw-r--r-- | fixincludes/fixincl.x | 7 | ||||
-rw-r--r-- | fixincludes/inclhack.def | 43 | ||||
-rw-r--r-- | fixincludes/tests/base/pthread.h | 27 |
4 files changed, 78 insertions, 11 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index d32327ba4d2..26b67aae618 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,9 +1,15 @@ +2006-10-03 Uros Bizjak <uros@kss-loka.si> + + * inclhack.def (glibc_mutex_init): Also fix + PTHREAD_MUTEX_(RECURSIVE|ERRORCHECK|ADAPTIVE)_NP and + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP initializers. + 2006-10-01 Uros Bizjak <uros@kss-loka.si> - * inclhack.def (glibc_mutex_init): New fix. - * tests/base/pthread.h: Update. + * inclhack.def (glibc_mutex_init): New fix. + * tests/base/pthread.h: Update. - * fixincl.x: Regenerate. + * fixincl.x: Regenerate. 2006-09-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index 38d4f276c8b..d6957846ff5 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 Saturday September 30, 2006 at 01:08:07 PM CEST + * It has been AutoGen-ed Tuesday October 3, 2006 at 07:43:53 AM CEST * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT CVS-MERGE THIS FILE, EITHER Sat Sep 30 13:08:07 CEST 2006 +/* DO NOT CVS-MERGE THIS FILE, EITHER Tue Oct 3 07:43:53 CEST 2006 * * You must regenerate it. Use the ./genfixes script. * @@ -2212,7 +2212,10 @@ static tTestDesc aGlibc_Mutex_InitTests[] = { */ static const char* apzGlibc_Mutex_InitPatch[] = { "sed", "-e", "/define[ \t]\\+PTHREAD_MUTEX_INITIALIZER[ \t]*\\\\/,+1s/{ { 0, } }/{ { 0, 0, 0, 0, 0, 0 } }/", + "-e", "s/{ \\(0, 0, 0, 0, PTHREAD_MUTEX_\\(RECURSIVE\\|ERRORCHECK\\|ADAPTIVE\\)_NP\\) }/{ \\1, 0 }/", + "-e", "s/{ \\(0, 0, 0, PTHREAD_MUTEX_\\(RECURSIVE\\|ERRORCHECK\\|ADAPTIVE\\)_NP\\) }/{ \\1, 0, 0 }/", "-e", "/define[ \t]\\+PTHREAD_RWLOCK_INITIALIZER[ \t]*\\\\/N;s/^[ \t]*#[ \t]*\\(define[ \t]\\+PTHREAD_RWLOCK_INITIALIZER[ \t]*\\\\\\)\\n[ \t]*{ { 0, } }/# if __WORDSIZE == 64\\n# \\1\\n { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }\\n# else\\n# \\1\\n { { 0, 0, 0, 0, 0, 0, 0, 0 } }\\n# endif/", + "-e", "s/{ \\(0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP\\) }/{ \\1, 0 }/", "-e", "/define[ \t]\\+PTHREAD_COND_INITIALIZER/s/{ { 0, } }/{ { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }/", (char*)NULL }; diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 04c6ef5f899..a1cdab17b53 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -1298,6 +1298,8 @@ fix = { select = '\{ *\{ *0, *\} *\}'; sed = "/define[ \t]\\+PTHREAD_MUTEX_INITIALIZER[ \t]*\\\\/,+1" "s/{ { 0, } }/{ { 0, 0, 0, 0, 0, 0 } }/"; + sed = "s/{ \\(0, 0, 0, 0, PTHREAD_MUTEX_\\(RECURSIVE\\|ERRORCHECK\\|ADAPTIVE\\)_NP\\) }/{ \\1, 0 }/"; + sed = "s/{ \\(0, 0, 0, PTHREAD_MUTEX_\\(RECURSIVE\\|ERRORCHECK\\|ADAPTIVE\\)_NP\\) }/{ \\1, 0, 0 }/"; sed = "/define[ \t]\\+PTHREAD_RWLOCK_INITIALIZER[ \t]*\\\\/" "N;s/^[ \t]*#[ \t]*" "\\(define[ \t]\\+PTHREAD_RWLOCK_INITIALIZER[ \t]*\\\\\\)\\n" @@ -1308,15 +1310,44 @@ fix = { "# \\1\\n" " { { 0, 0, 0, 0, 0, 0, 0, 0 } }\\n" "# endif/"; + sed = "s/{ \\(0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP\\) }/{ \\1, 0 }/"; sed = "/define[ \t]\\+PTHREAD_COND_INITIALIZER/" "s/{ { 0, } }/{ { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }/"; - test_text = - "#define PTHREAD_MUTEX_INITIALIZER \\\\\n" - " { { 0, } }\n" - "# define PTHREAD_RWLOCK_INITIALIZER \\\\\n" - " { { 0, } }\n" - "#define PTHREAD_COND_INITIALIZER { { 0, } }"; + test_text = <<- _EOText_ +#define PTHREAD_MUTEX_INITIALIZER \\ + { { 0, } } +#ifdef __USE_GNU +# if __WORDSIZE == 64 +# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \\ + { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } } +# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \\ + { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } } +# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \\ + { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } } +# else +# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \\ + { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } } +# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \\ + { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } } +# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \\ + { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } } +# endif +#endif +# define PTHREAD_RWLOCK_INITIALIZER \\ + { { 0, } } +# ifdef __USE_GNU +# if __WORDSIZE == 64 +# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \\ + { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \\ + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } +# else +# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \\ + { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } +# endif +# endif +#define PTHREAD_COND_INITIALIZER { { 0, } } +_EOText_; }; diff --git a/fixincludes/tests/base/pthread.h b/fixincludes/tests/base/pthread.h index b1c4d517bce..e75a6ee0e33 100644 --- a/fixincludes/tests/base/pthread.h +++ b/fixincludes/tests/base/pthread.h @@ -59,6 +59,23 @@ #if defined( GLIBC_MUTEX_INIT_CHECK ) #define PTHREAD_MUTEX_INITIALIZER \ { { 0, 0, 0, 0, 0, 0 } } +#ifdef __USE_GNU +# if __WORDSIZE == 64 +# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0 } } +# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0 } } +# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0 } } +# else +# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, 0 } } +# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, 0 } } +# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, 0 } } +# endif +#endif # if __WORDSIZE == 64 # define PTHREAD_RWLOCK_INITIALIZER \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } @@ -66,6 +83,16 @@ # define PTHREAD_RWLOCK_INITIALIZER \ { { 0, 0, 0, 0, 0, 0, 0, 0 } } # endif +# ifdef __USE_GNU +# if __WORDSIZE == 64 +# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ + { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } +# else +# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ + { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, 0 } } +# endif +# endif #define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } } #endif /* GLIBC_MUTEX_INIT_CHECK */ |