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 2005/12/02 22:41:46 UTC

svn commit: r351841 - /incubator/stdcxx/trunk/src/assert.cpp

Author: sebor
Date: Fri Dec  2 13:41:39 2005
New Revision: 351841

URL: http://svn.apache.org/viewcvs?rev=351841&view=rev
Log:
2005-12-02  Martin Sebor  <se...@roguewave.com>

	STDCXX-81
	* assert.cpp: On Solaris 8 and beyond, declared the printstack function
	instead of #including <ucontext.h>, the system header in which it is
	declared, in order to avoid having to #define enabling macros (i.e.,
	__EXTENSIONS__) and deal with the breakage when using a strict compiler
	such as EDG eccp with the long long extension (used in some system other
	headers) disabled.

Modified:
    incubator/stdcxx/trunk/src/assert.cpp

Modified: incubator/stdcxx/trunk/src/assert.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/src/assert.cpp?rev=351841&r1=351840&r2=351841&view=diff
==============================================================================
--- incubator/stdcxx/trunk/src/assert.cpp (original)
+++ incubator/stdcxx/trunk/src/assert.cpp Fri Dec  2 13:41:39 2005
@@ -2,7 +2,7 @@
  *
  * assert.cpp - definition of debugging assertion functions
  *
- * $Id: //stdlib/dev/source/stdlib/assert.cpp#7 $
+ * $Id$
  *
  ***************************************************************************
  *
@@ -51,27 +51,24 @@
     backtrace_symbols_fd (array, size, fd);
 }
 
-}
+}   // namespace __rw
 
 #  define STACK_TRACE()   _RW::__rw_stack_trace (2)
 
-#elif defined (_RWSTD_OS_SUNOS) \
+#elif    defined (_RWSTD_OS_SUNOS) \
       && (5 < _RWSTD_OS_MAJOR || 5 == _RWSTD_OS_MAJOR && 8 < _RWSTD_OS_MINOR)
 
-   // only Solaris 9 and better defines printstack()
-
-#  ifndef _RWSTD_NO_PURE_LIBC_HEADERS
-#    ifndef __EXTENSIONS__
-       // needed to bring in the definitions of sigset_t and stack_t
-       // when using pure libc headers
-#      define __EXTENSIONS__
-#    endif   // __EXTENSIONS__
-#  endif   // _RWSTD_NO_PURE_LIBC_HEADERS
+// only Solaris 9 and better defines printstack() (in <ucontext.h>)
+// declare the function here instead of including the header to avoid
+// having to #define enabling macros (i.e., __EXTENSIONS__) and deal
+// with the breakage when using a strict compiler such as EDG eccp
+// with the long long extension (used in some system headers) disabled
+extern "C" int printstack (int);
 
-#  include <ucontext.h>
+#    define STACK_TRACE()   printstack (2)
+#endif
 
-#  define STACK_TRACE()   printstack (2)
-#else
+#ifndef STACK_TRACE
 #  define STACK_TRACE()   (void)0
 #endif   // __HP_aCC