This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: conditional use of __thread


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]