This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fixinc for Solaris' pthread.h
DJ Delorie wrote:
> Maybe I'm missing something, then. For solaris 7-9, we already have a
> fix that changes the initializer. I'm only suggesting an *additional*
You're right. I was misremembering and went off on an old tangent.
I've been too focused on other problems and I'm leaving for a
vacation anyway. Never mind. :-)
The other fix works for Solaris 6, too. So, my comments now reduce to:
/*
+ * Sun Solaris 2.6 defines PTHREAD_{MUTEX|COND}_INITIALIZER incorrectly,
+ * so we replace them with versions that correspond to the definition. We
* also explicitly name this fix "1" and the next fix "2" because this one
* does not deal with the last field. This fix needs to run before the next.
+ */
+ fix = {
+ hackname = solaris_mutex_init_1;
+ select = '@\(#\)pthread.h' "[ \t]+1.1[0-9][ \t]+97/[0-9/]+ SMI";
+ files = pthread.h;
sed = "/define[ \t]*PTHREAD_MUTEX_INI/s/{0, 0,/{{{0}, 0}, {{{0}}},/\n"
"/define[ \t]*PTHREAD_COND_INI/s/{0,/{{{0},0},/";
+ test_text =
+ '#ident "@(#)pthread.h 1.16 97/05/05 SMI"'"\n"
+ "#define PTHREAD_MUTEX_INITIALIZER\t{0, 0, 0}\n"
+ "#define PTHREAD_COND_INITIALIZER\t{0, 0} /* */\n";
+ };
plus fixes to the fixinc/test/base/pthread.h file. :-)
Thanks!