diff options
author | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-01 05:47:33 +0000 |
---|---|---|
committer | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-01 05:47:33 +0000 |
commit | a1b116172af79e584c876cce29be97bc2e4e38cf (patch) | |
tree | a45e7b9bb89be3197d95776b3f0bc2349489a9f6 /fixincludes/inclhack.def | |
parent | eac85a24a099200f590241d6ee6ac0062529f8be (diff) | |
download | gcc-a1b116172af79e584c876cce29be97bc2e4e38cf.tar.gz |
* inclhack.def (pthread_mutex_init): New fix.
* tests/base/pthread.h: Update.
* fixincl.x: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117343 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fixincludes/inclhack.def')
-rw-r--r-- | fixincludes/inclhack.def | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index acef2588c85..04c6ef5f899 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -1288,6 +1288,38 @@ fix = { }; +/* glibc-2.3.5 defines pthread mutex initializers incorrectly, + * so we replace them with versions that correspond to the + * definition. + */ +fix = { + hackname = glibc_mutex_init; + files = pthread.h; + select = '\{ *\{ *0, *\} *\}'; + sed = "/define[ \t]\\+PTHREAD_MUTEX_INITIALIZER[ \t]*\\\\/,+1" + "s/{ { 0, } }/{ { 0, 0, 0, 0, 0, 0 } }/"; + sed = "/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/"; + 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, } }"; +}; + + /* * Fix these files to use the types we think they should for * ptrdiff_t, size_t, and wchar_t. |