public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol Date: Thu, 14 Jul 2011 12:34:00 -0000 [thread overview] Message-ID: <bug-49745-4-jzgMr0Wpbf@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-49745-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49745 --- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 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++ (<mutex> 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 <unistd.h> #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 <unistd.h> defines _POSIX_TIMEOUTS.
next prev parent reply other threads:[~2011-07-14 12:34 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-07-14 10:29 [Bug c++/49745] New: " mathieu.malaterre at gmail dot com 2011-07-14 10:32 ` [Bug libstdc++/49745] " rguenth at gcc dot gnu.org 2011-07-14 10:52 ` redi at gcc dot gnu.org 2011-07-14 11:02 ` redi at gcc dot gnu.org 2011-07-14 11:13 ` redi at gcc dot gnu.org 2011-07-14 12:02 ` paolo.carlini at oracle dot com 2011-07-14 12:08 ` paolo.carlini at oracle dot com 2011-07-14 12:13 ` redi at gcc dot gnu.org 2011-07-14 12:31 ` paolo.carlini at oracle dot com 2011-07-14 12:34 ` jakub at gcc dot gnu.org [this message] 2011-07-14 12:35 ` jakub at gcc dot gnu.org 2011-07-14 12:45 ` paolo.carlini at oracle dot com 2011-07-14 21:51 ` paolo.carlini at oracle dot com 2011-07-14 21:55 ` jakub at gcc dot gnu.org 2011-07-14 22:00 ` paolo.carlini at oracle dot com 2011-07-15 10:24 ` paolo.carlini at oracle dot com 2011-07-15 10:51 ` jakub at gcc dot gnu.org 2011-07-15 10:53 ` paolo.carlini at oracle dot com 2011-07-15 11:54 ` paolo.carlini at oracle dot com 2011-07-15 12:10 ` paolo.carlini at oracle dot com 2011-07-15 21:53 ` paolo at gcc dot gnu.org 2011-07-15 21:55 ` paolo.carlini at oracle dot com 2021-10-10 12:51 ` hjl.tools at gmail dot com 2021-10-25 18:30 ` law at gcc dot gnu.org 2021-11-10 12:04 ` cvs-commit at gcc dot gnu.org 2021-11-24 11:50 ` cvs-commit at gcc dot gnu.org 2022-01-08 10:51 ` pinskia at gcc dot gnu.org 2022-04-26 13:12 ` cvs-commit at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-49745-4-jzgMr0Wpbf@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).