public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org>,
	Jason Merrill <jason@redhat.com>,
	Jakub Jelinek <jakub@redhat.com>,
	John David Anglin <dave.anglin@bell.net>
Subject: Re: [PATCH] c++: Predefine __STDCPP_THREADS__ in the compiler if thread model is not single
Date: Mon, 16 Nov 2020 16:49:11 +0000	[thread overview]
Message-ID: <20201116164911.GA958467@redhat.com> (raw)
In-Reply-To: <87tutp1d9u.fsf@tromey.com>

On 16/11/20 09:23 -0700, Tom Tromey wrote:
>Jakub> If it is done in the library, it will be defined only if any of the library
>Jakub> headers are included.
>Jakub> The https://eel.is/c++draft/cpp.predefined wording doesn't look like it
>Jakub> would allow defining it only if certain headers are included
>Jakub> (unlike e.g. the __cpp_lib_* macros which have associated list of headers
>Jakub> that should define those).
>
>Also I was wondering if there's a C analogue.
>I found http://www.open-std.org/jtc1/sc22/WG14/www/docs/n2069.pdf but I
>have no idea whether this is just a paper or was adopted.

C11 and later say:

_ _STDC_NO_THREADS_ _ The integer constant 1, intended to indicate that the
implementation does not support the <threads.h> header.

You can probably guess how useful it is in practice:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53769



  reply	other threads:[~2020-11-16 16:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 17:29 Jakub Jelinek
2020-11-13 18:20 ` Jeff Law
2020-11-13 19:03   ` John David Anglin
2020-11-13 19:05     ` Jeff Law
2020-11-13 19:20 ` Tom Tromey
2020-11-13 21:39   ` Jason Merrill
2020-11-13 21:46     ` Jakub Jelinek
2020-11-13 21:50       ` Jason Merrill
2020-11-13 22:52       ` Jonathan Wakely
2020-11-16 16:23       ` Tom Tromey
2020-11-16 16:49         ` Jonathan Wakely [this message]
2020-11-13 21:42   ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201116164911.GA958467@redhat.com \
    --to=jwakely@redhat.com \
    --cc=dave.anglin@bell.net \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).