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 [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 124033858025 for ; Fri, 10 Dec 2021 18:24:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 124033858025 Received: from mail-yb1-f200.google.com (mail-yb1-f200.google.com [209.85.219.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-419-FSfZqTAQPKC98ceYN-i3qQ-1; Fri, 10 Dec 2021 13:24:30 -0500 X-MC-Unique: FSfZqTAQPKC98ceYN-i3qQ-1 Received: by mail-yb1-f200.google.com with SMTP id j204-20020a2523d5000000b005c21574c704so17727211ybj.13 for ; Fri, 10 Dec 2021 10:24:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JdhvNid6hLkqH73baD4YL6bgZroW19EqGBI4mEeQTMk=; b=aNTorOcVCLSChfx3Y+/viSuWu8vpkRLRsHQ2x08Dzu+/7oh89YtKhySfJgcbktikhk r0+qkBSA1ZoDI6vuK+XGDRKjks3hQcPx3dFL4ceRunGTKe4+OvZlD8S4ij4PBV9149Yt I/ScdElUYC/xdNLVoNI8ywa8aNCDAbhm9qqIRTP9WHZKAawPB4HPLmDeNafhzaDRBnrN M/O3fzKWoXnq2FKIPrz9s79RGOndsxbr0500DCAtIRhZz41WHep3mvXn3uRZwx42Pdiz EXWo32vGGLNGi89sR0VcE2x8KklA47htomBRXcMY06g4wudYJtHGaR/jBsAjqp21xUSf iO5Q== X-Gm-Message-State: AOAM532LtlHayiSzJyjO69LpJ/S7nc//p/fRXy8JBclfKMsnCh93Zo3f ARnmhKTGgTd0I7Cuzdo4DtsLLQFLgZmmp+DH32BDswC0HCFJGGXzh2PJJk+ye2JcJ5yud7TP+Zy AtoT43d3hNpf3VwjrKovAswKIsRCIpnRaDg== X-Received: by 2002:a05:6902:1501:: with SMTP id q1mr19150641ybu.580.1639160669863; Fri, 10 Dec 2021 10:24:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwuUtZIw+EKSlgttTHXYSidD8/O4G8sMSBSMwXyu41BlRAiO+ZSjFYPT1wVFzrliksiQYiLmcixCrpQZACwtG4= X-Received: by 2002:a05:6902:1501:: with SMTP id q1mr19150615ybu.580.1639160669647; Fri, 10 Dec 2021 10:24:29 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Fri, 10 Dec 2021 18:24:18 +0000 Message-ID: Subject: Re: [PATCH] #undef isblank before def or decl in libstdc++ headers To: Olivier Hainque Cc: "libstdc++" , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 10 Dec 2021 18:24:33 -0000 On Fri, 10 Dec 2021 at 17:07, Olivier Hainque via Libstdc++ wrote: > > Hello, > > The attached patch helps fix a build failure of libstdc++ > on some variants of VxWorks where the system headers expose > an "isblank" macro. > > I understand this kind of thing normally is handled through > fixincludes, however fixincludes on VxWorks is very tricky and > we already have > > libstdc++-v3/include/c_global/cctype:#undef isblank > libstdc++-v3/include/tr1/cctype:#undef isblank > > so the suggestion here is to simply do the same in a couple > more places. Both of those places already include so I think we should just do this: --- a/libstdc++-v3/include/c_global/cctype +++ b/libstdc++-v3/include/c_global/cctype @@ -78,10 +78,10 @@ namespace std #if __cplusplus >= 201103L -#ifdef _GLIBCXX_USE_C99_CTYPE_TR1 - #undef isblank +#ifdef _GLIBCXX_USE_C99_CTYPE_TR1 + namespace std { using ::isblank; I'm curious why _GLIBCXX_USE_C99_CTYPE_TR1 is not defined if VxWorks has isblank, the configure check is: # Check for the existence of functions. AC_CACHE_CHECK([for ISO C99 support to TR1 in ], glibcxx_cv_c99_ctype_tr1, [ AC_TRY_COMPILE([#include ], [int ch; int ret; ret = isblank(ch); ],[glibcxx_cv_c99_ctype_tr1=yes], [glibcxx_cv_c99_ctype_tr1=no]) ]) if test x"$glibcxx_cv_c99_ctype_tr1" = x"yes"; then AC_DEFINE(_GLIBCXX_USE_C99_CTYPE_TR1, 1, [Define if C99 functions in should be imported in in namespace std::tr1.]) fi In any case, undef'ing it unconditionally in should work, and avoids having to do it in multiple places (we still need it in because that is used in C++98 code, whereas the other definitions of functions called "isblank" were added for C++11).