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 D15E5385801D for ; Fri, 10 Dec 2021 18:24:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D15E5385801D Received: from mail-yb1-f199.google.com (mail-yb1-f199.google.com [209.85.219.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-17-sxJjBVSdPgGjR6ZPy2U8_g-1; Fri, 10 Dec 2021 13:24:30 -0500 X-MC-Unique: sxJjBVSdPgGjR6ZPy2U8_g-1 Received: by mail-yb1-f199.google.com with SMTP id l145-20020a25cc97000000b005c5d04a1d52so17797447ybf.23 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=2o9RGKcE+CdmqIukKuiPCLotbiFOfa+fc+Yx25F0WrVr7sQQP2WI5B7sMqDECZxQFf tX2N2kbXpbK0vUsjzF7hYB44DHW0qw5qf3Gspm4xupgh33SvJ+vUoUT4vDR3nnW+gTvs CXTMwcZrcAJ2K6BUsMa6PQ5sbIglbowVBirgPrHYBah1TfdQ1+o3G+WVMqMD6e4Y3TF4 Ogd9Ya/xWVBKpNPZuJmV3SUdMAJFTXLwbRpCvC074Qbl/KOODo1tPiBnuTAt3j5B7K25 0ba9CHKQP738zcLbLkZ03rax9IUzNtnPqyMjAxDkK8si9jTyGhwomhs0fkParYgGu1qi /+Pg== X-Gm-Message-State: AOAM530XWYv/z6Ft55WGshUpu+QIFxeG+UiB63cXIo98neaFdbDiXWOO JxXFm/5MXteQZMNXE4FUa7s0ASh6uRRP3t6JUv3OGFOh7Lz5/8a4WjPVYejfbSgqMx2WxK8rzae p+JqFDalFCPXUiuLR0w4PS5OyW3g4r/A= X-Received: by 2002:a05:6902:1501:: with SMTP id q1mr19150642ybu.580.1639160669864; 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.2 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=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ 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).