From patchwork Wed Nov 9 18:40:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel F T Gomes X-Patchwork-Id: 17348 X-Patchwork-Delegate: joseph@codesourcery.com Received: (qmail 15193 invoked by alias); 9 Nov 2016 18:41:28 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15012 invoked by uid 89); 9 Nov 2016 18:41:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RCVD_IN_SEMBACKSCATTER autolearn=no version=3.3.2 spammy=murphy, 2411, derivative, sk:libche X-HELO: mx0a-001b2d01.pphosted.com From: "Gabriel F. T. Gomes" To: libc-alpha@sourceware.org Subject: [PATCH 4/8] Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__ Date: Wed, 9 Nov 2016 16:40:55 -0200 In-Reply-To: <1478716859-3246-1-git-send-email-gftg@linux.vnet.ibm.com> References: <1478716859-3246-1-git-send-email-gftg@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16110918-1523-0000-0000-0000024A1A3D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16110918-1524-0000-0000-000029CF2A57 Message-Id: <1478716859-3246-5-git-send-email-gftg@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-11-09_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611090343 From: "Paul E. Murphy" This is defined by TS 18661-3 for supporting the _FloatN and _FloatNx types. This will also implicitly enforce a minimum GCC 4.9. Given the standard is a C11 derivative, it would seem reasonable to assume a C11 compiler with _Generic support. This allows for much simpler type classification macros which in theory should be supported on any C11 compiler. * bits/libc-header-start.h: (__GLIBC_USR_IEC_60559_TYPES_EXT): New macro. --- bits/libc-header-start.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bits/libc-header-start.h b/bits/libc-header-start.h index ee6a876..251ff05 100644 --- a/bits/libc-header-start.h +++ b/bits/libc-header-start.h @@ -59,3 +59,18 @@ #else # define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 #endif + +/* ISO/IEC TS 18661-3:2014 defines the + __STDC_WANT_IEC_60559_TYPES_EXT__ macro. + + Note, as a tradeoff for keeping the headers simple, this will + require C11 Generic support. Thus, GCC 4.9 is mandated when + requesting this support and using GCC. */ +#undef __GLIBC_USE_IEC_60559_TYPES_EXT +#if (defined __STDC_WANT_IEC_60559_TYPES_EXT__ || defined __USE_GNU) \ + && defined __USE_ISOC11 \ + && ((defined __GNUC__ && __GNUC_PREREQ (4, 9)) || !defined __GNUC__) +# define __GLIBC_USE_IEC_60559_TYPES_EXT 1 +#else +# define __GLIBC_USE_IEC_60559_TYPES_EXT 0 +#endif