From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 7FBC2395BC59 for ; Mon, 16 Nov 2020 16:49:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7FBC2395BC59 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-592-f9u27hh4O5CZXsj8VbOEGw-1; Mon, 16 Nov 2020 11:49:13 -0500 X-MC-Unique: f9u27hh4O5CZXsj8VbOEGw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C42D6D8EC1; Mon, 16 Nov 2020 16:49:12 +0000 (UTC) Received: from localhost (unknown [10.33.36.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4DDAE10016DA; Mon, 16 Nov 2020 16:49:12 +0000 (UTC) Date: Mon, 16 Nov 2020 16:49:11 +0000 From: Jonathan Wakely To: Tom Tromey Cc: Jakub Jelinek via Gcc-patches , Jason Merrill , Jakub Jelinek , John David Anglin Subject: Re: [PATCH] c++: Predefine __STDCPP_THREADS__ in the compiler if thread model is not single Message-ID: <20201116164911.GA958467@redhat.com> References: <20201113172945.GH3788@tucnak> <87k0up9i86.fsf@tromey.com> <20201113214659.GL3788@tucnak> <87tutp1d9u.fsf@tromey.com> MIME-Version: 1.0 In-Reply-To: <87tutp1d9u.fsf@tromey.com> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Nov 2020 16:49:20 -0000 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 header. You can probably guess how useful it is in practice: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53769