You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2006/06/30 02:27:25 UTC

svn commit: r418157 - in /incubator/stdcxx/trunk/include/ansi: cstdlib stdlib.h

Author: sebor
Date: Thu Jun 29 17:27:24 2006
New Revision: 418157

URL: http://svn.apache.org/viewvc?rev=418157&view=rev
Log:
2006-06-29  Martin Sebor  <se...@roguewave.com>

	STDCXX-184
	* cstdlib (abs): Hacked around an HP aCC quirk when using system
	headers in /usr/include without the compiler's wrappers (i.e.,
	when -I/usr/include is before the compiler's include directory
	in the preprocessor seacrh path). See STDCXX-244.
	* stdlib.h: Same.

Modified:
    incubator/stdcxx/trunk/include/ansi/cstdlib
    incubator/stdcxx/trunk/include/ansi/stdlib.h

Modified: incubator/stdcxx/trunk/include/ansi/cstdlib
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/ansi/cstdlib?rev=418157&r1=418156&r2=418157&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/ansi/cstdlib (original)
+++ incubator/stdcxx/trunk/include/ansi/cstdlib Thu Jun 29 17:27:24 2006
@@ -189,9 +189,13 @@
 
     using ::abort;
 
-#if (defined (_RWSTD_NO_ABS) || defined (__hpux)) && defined (_RWSTD_NO_ABS_INT)
-
-    // working around a quirk in HP-UX <stdlib.h> and <math.h>
+#if    defined (_RWSTD_NO_ABS) && defined (_RWSTD_NO_ABS_INT) \
+    || defined (__HP_aCC) \
+    && defined (_MATH_INCLUDED) && !defined (__MATH_INCLUDED)
+
+// hacking around an HP aCC quirk when using system headers
+// in /usr/include without the compiler's wrappers (i.e.,
+// when -I/usr/include is on the command line)
 
 }   // namespace std
 
@@ -206,7 +210,7 @@
 
 namespace std {
 
-#endif   // (_RWSTD_NO_ABS || __hpux) && _RWSTD_NO_ABS_INT
+#endif   // _RWSTD_NO_ABS && _RWSTD_NO_ABS_INT ...
 
     using ::abs;
 

Modified: incubator/stdcxx/trunk/include/ansi/stdlib.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/ansi/stdlib.h?rev=418157&r1=418156&r2=418157&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/ansi/stdlib.h (original)
+++ incubator/stdcxx/trunk/include/ansi/stdlib.h Thu Jun 29 17:27:24 2006
@@ -2,7 +2,7 @@
  *
  * stdlib.h
  *
- * $Id: //stdlib/dev/include/ansi/stdlib.h#15 $
+ * $Id$
  *
  ***************************************************************************
  *
@@ -91,6 +91,24 @@
 #else
 #  include _RWSTD_ANSI_C_STDLIB_H
 
-#undef ldiv
+#  if    defined (__HP_aCC) \
+      && defined (_MATH_INCLUDED) && !defined (__MATH_INCLUDED)
+
+// hacking around an HP aCC quirk when using system headers
+// in /usr/include without the compiler's wrappers (i.e.,
+// when -I/usr/include is on the command line)
+
+extern "C" {
+
+inline int abs (int __x)
+{
+    return __x < 0 ? -__x : __x;
+}
+
+}   // extern "C"
+
+#  endif   // HP aCC && /usr/include/math.h included
+
+#  undef ldiv
 
 #endif   // _RWSTD_NO_DEPRECATED_C_HEADERS