Return-Path: Delivered-To: apmail-incubator-stdcxx-commits-archive@www.apache.org Received: (qmail 56739 invoked from network); 14 Oct 2005 19:08:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Oct 2005 19:08:01 -0000 Received: (qmail 89910 invoked by uid 500); 14 Oct 2005 19:08:01 -0000 Delivered-To: apmail-incubator-stdcxx-commits-archive@incubator.apache.org Received: (qmail 89891 invoked by uid 500); 14 Oct 2005 19:08:01 -0000 Mailing-List: contact stdcxx-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-commits@incubator.apache.org Received: (qmail 89880 invoked by uid 500); 14 Oct 2005 19:08:01 -0000 Delivered-To: apmail-incubator-stdcxx-cvs@incubator.apache.org Received: (qmail 89876 invoked by uid 99); 14 Oct 2005 19:08:01 -0000 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 14 Oct 2005 12:08:00 -0700 Received: (qmail 56566 invoked by uid 65534); 14 Oct 2005 19:07:40 -0000 Message-ID: <20051014190740.56565.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r321186 - /incubator/stdcxx/trunk/include/ansi/cstdlib Date: Fri, 14 Oct 2005 19:07:40 -0000 To: stdcxx-cvs@incubator.apache.org From: sebor@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sebor Date: Fri Oct 14 12:07:38 2005 New Revision: 321186 URL: http://svn.apache.org/viewcvs?rev=321186&view=rev Log: 2005-10-14 Martin Sebor STDCXX-47 * cstdlib (abs): Moved the definition of the int overload from namespace std to the global scope and introduced it into std via a using declaration for consistency with the rest of the C functions declared in the same block. Guarded said definition with the _RWSTD_NO_ABS_INT config macro to avoid colliding with the same function in . Modified: incubator/stdcxx/trunk/include/ansi/cstdlib Modified: incubator/stdcxx/trunk/include/ansi/cstdlib URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/ansi/cstdlib?rev=321186&r1=321185&r2=321186&view=diff ============================================================================== --- incubator/stdcxx/trunk/include/ansi/cstdlib (original) +++ incubator/stdcxx/trunk/include/ansi/cstdlib Fri Oct 14 12:07:38 2005 @@ -189,18 +189,26 @@ using ::abort; -#if defined (_RWSTD_NO_ABS) || defined (__hpux) +#if (defined (_RWSTD_NO_ABS) || defined (__hpux)) && defined (_RWSTD_NO_ABS_INT) // working around a quirk in HP-UX and - inline int abs (int __x) - { - return __x < 0 ? -__x : __x; - } +} // namespace std + +extern "C" { + +inline int abs (int __x) +{ + return __x < 0 ? -__x : __x; +} + +} // extern "C" + +namespace std { + +#endif // (_RWSTD_NO_ABS || __hpux) && _RWSTD_NO_ABS_INT -#else using ::abs; -#endif // _RWSTD_NO_ABS using ::atexit; using ::atof; @@ -232,7 +240,8 @@ using ::system; using ::wcstombs; using ::wctomb; -} // std + +} // namespace std #endif // !_RWSTD_NO_NAMESPACE && !_RWSTD_NO_HONOR_STD && !_RWSTD_NO_USING_LIBC_IN_STD