This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Do not include <cstdlib> (in a few more places)
- From: Paolo Carlini <pcarlini at suse dot de>
- To: "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 22 Apr 2007 12:39:26 +0200
- Subject: [v3] Do not include <cstdlib> (in a few more places)
Hi,
tested x86-linux without PCHs, committed to mainline.
Paolo.
///////////////
2007-04-22 Paolo Carlini <pcarlini@suse.de>
* include/ext/concurrence.h: Do not include <cstdlib>, use
__builtin_abort.
* include/debug/debug.h: Likewise.
* include/tr1/memory: Likewise.
* include/tr1/boost_shared_ptr.h: Likewise.
* include/tr1/functional: Likewise.
Index: include/ext/concurrence.h
===================================================================
--- include/ext/concurrence.h (revision 123778)
+++ include/ext/concurrence.h (working copy)
@@ -1,6 +1,6 @@
// Support for concurrent programing -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006
+// Copyright (C) 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -36,7 +36,6 @@
#ifndef _CONCURRENCE_H
#define _CONCURRENCE_H 1
-#include <cstdlib>
#include <exception>
#include <bits/gthr.h>
#include <bits/functexcept.h>
@@ -90,7 +89,7 @@
#if __EXCEPTIONS
throw __concurrence_lock_error();
#else
- std::abort();
+ __builtin_abort();
#endif
}
@@ -100,7 +99,7 @@
#if __EXCEPTIONS
throw __concurrence_unlock_error();
#else
- std::abort();
+ __builtin_abort();
#endif
}
Index: include/debug/debug.h
===================================================================
--- include/debug/debug.h (revision 123778)
+++ include/debug/debug.h (working copy)
@@ -1,6 +1,6 @@
// Debugging support implementation -*- C++ -*-
-// Copyright (C) 2003, 2005, 2006
+// Copyright (C) 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -80,7 +80,6 @@
#else
-# include <cstdlib>
# include <cstdio>
# include <debug/macros.h>
@@ -96,7 +95,7 @@
{
printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
__function, __condition);
- abort();
+ __builtin_abort();
}
} // namespace __debug
} // namespace std
Index: include/tr1/memory
===================================================================
--- include/tr1/memory (revision 123778)
+++ include/tr1/memory (working copy)
@@ -36,7 +36,6 @@
#define _TR1_MEMORY 1
#include <cstddef> // std::size_t
-#include <cstdlib> // std::abort
#include <exception> // std::exception
#include <new> // std::bad_alloc
#include <typeinfo> // std::type_info in get_deleter
Index: include/tr1/boost_shared_ptr.h
===================================================================
--- include/tr1/boost_shared_ptr.h (revision 123778)
+++ include/tr1/boost_shared_ptr.h (working copy)
@@ -1,6 +1,6 @@
// <tr1/boost_shared_ptr.h> -*- C++ -*-
-// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -73,7 +73,7 @@
#if __EXCEPTIONS
throw bad_weak_ptr();
#else
- std::abort();
+ __builtin_abort();
#endif
}
Index: include/tr1/functional
===================================================================
--- include/tr1/functional (revision 123778)
+++ include/tr1/functional (working copy)
@@ -36,7 +36,6 @@
#pragma GCC system_header
-#include <cstdlib> // for std::abort
#include <cmath> // for std::frexp
#include <string> // for std::tr1::hash
#include <functional>
@@ -2183,7 +2182,7 @@
#if __EXCEPTIONS
throw bad_function_call();
#else
- std::abort();
+ __builtin_abort();
#endif
}
return _M_invoker(_M_functor, __args...);