From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14463 invoked by alias); 14 Jul 2011 12:34:23 -0000 Received: (qmail 14309 invoked by uid 22791); 14 Jul 2011 12:34:22 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,SARE_HEAD_8BIT_SPAM,SARE_SUB_ENC_UTF8,TW_BJ,TW_SV X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Jul 2011 12:34:09 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/49745] error:=?UTF-8?Q?=20=E2=80=98int=20truncate=E2=80=99=20redeclared=20as=20different=20kind=20of=20symbol?= X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 14 Jul 2011 12:34:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-07/txt/msg01108.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49745 --- Comment #9 from Jakub Jelinek 2011-07-14 12:33:16 UTC --- svn blame isn't hard to use. You'll find out that the unistd.h include was added by http://gcc.gnu.org/ml/gcc-patches/2002-10/msg01666.html There are still some of the unistd.h guard macros used in gthr*, so you can't just drop that. But, two of the three macros are limited to libobjc (the scheduling stuff), so if it wasn't for _POSIX_TIMEOUTS for __gthread_mutex_timedwait, you could guard the unistd.h include with #if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK) Unfortunately, the remaining one, _POSIX_TIMEOUTS and defining __gthread_mutex_timedlock if it is present, is used in libstdc++ ( in particular, and apparently unconditionally there, so it will just not compile on prehistoric OSes which lack pthread_mutex_timedlock or on systems that don't use gthr-posix.h but other gthr-*.h headers instead). So, if you want to avoid including unistd.h, you'd need to e.g. add some configure test in libstdc++ and in gthr-posix.h use #if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK) \ || !defined(_GTHR_HAS_POSIX_TIMEOUTS) #include #ifdef _POSIX_TIMEOUTS #define _GTHR_HAS_POSIX_TIMEOUTS _POSIX_TIMEOUTS #endif #endif and use _GTHR_HAS_POSIX_TIMEOUTS instead of _POSIX_TIMEOUTS in gthr.h and arrange for libstdc++ headers to define _GTHR_HAS_POSIX_TIMEOUTS based on whether defines _POSIX_TIMEOUTS.