From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27913 invoked by alias); 20 Jan 2011 20:01:41 -0000 Received: (qmail 27900 invoked by uid 22791); 20 Jan 2011 20:01:40 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Jan 2011 20:01:36 +0000 Received: by ywi6 with SMTP id 6so319260ywi.20 for ; Thu, 20 Jan 2011 12:01:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.218.5 with SMTP id ho5mr3136300icb.403.1295553694358; Thu, 20 Jan 2011 12:01:34 -0800 (PST) Received: by 10.42.230.66 with HTTP; Thu, 20 Jan 2011 12:01:34 -0800 (PST) In-Reply-To: References: Date: Thu, 20 Jan 2011 20:01:00 -0000 Message-ID: Subject: Re: g++ cross distro compilation problem From: Jonathan Wakely To: Nick Stokes Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg00316.txt.bz2 On 20 January 2011 19:57, Jonathan Wakely wrote: > On 20 January 2011 19:28, Nick Stokes wrote: >> >> Great! This indeed revealed it. =A0In /usr/include/locale.h (same >> location, line =A0133, in both distros actually) =A0there is #ifdef >> __USE_GNU =A0on CentOS version, which is =A0#ifdef __USE_XOPEN2K8 in >> SUSE's version. =A0 So, in fact if I define `__USE_XOPEN2K8' =A0while >> compiling on SUSE, it works. Hmm, go figure.. This can not be the >> right way to do this. What am I missing? > > I don't know why they're different (on my glibc 2.12 system the > uselocale definition is guarded by __USE_GNU, just like your CentOS > system) but it looks like you've found the solution. > > Users are not supposed to use the __USE_XXX macros, instead you should > define _GNU_SOURCE to enable __USE_GNU and _POSIX_C_SOURCE=3D200809L (or > greater) to enable __USE_XOPEN2K8. It looks as though you can also define _XOPEN_SOURCE=3D700 (or greater) to set __USE_XOPEN2K8 Either way, you should use one of those standard feature test macros, not the __USE_XOPEN2K8 one which is an internal implementation details, see man feature_test_macros for more details.