This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: conditional use of __thread
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Arnaud Charlet <charlet at ACT-Europe dot FR>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 25 Jul 2004 07:36:50 -0700
- Subject: Re: conditional use of __thread
- References: <20040725114100.A28346@dublin.act-europe.fr>
Arnaud Charlet <charlet@ACT-Europe.FR> writes:
> In a GNAT C run time file, I'd like to make use of the __thread keyword
> when it is supported by GCC.
>
> So far, I couldn't find a way (macro ?) to know in a run time (non
> compiler) file whether __thread was supported or not.
>
> Is there such a way ?
Doesn't look like it at present.
> If not, what would be a reasonable way to add this info ?
Add something like
if (targetm.have_tls)
cpp_define (pfile, "__TLS__");
to c-cppbuiltin.c::c_cpp_builtins; document the new feature in
cpp.texi (Common Predefined Macros section).
I'm not sure __TLS__ is the best name for this macro. Anyone have a
suggestion?
zw