stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r321186 - /incubator/stdcxx/trunk/include/ansi/cstdlib
Date Fri, 14 Oct 2005 19:07:40 GMT
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  <sebor@roguewave.com>

	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 <cmath>.

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 <stdlib.h> and <math.h>
 
-    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
 



Mime
View raw message