aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2012-11-06 11:03:45 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2012-11-06 11:03:45 +0000
commitc4ae9877307939806b3f161f55ce635002227bad (patch)
treea099706908fd75531c11a09c384562cc3830e35d
parent1115dd7ed7f7aec9c532b74ae01390e0fc0f57cf (diff)
downloadgcc-c4ae9877307939806b3f161f55ce635002227bad.zip
gcc-c4ae9877307939806b3f161f55ce635002227bad.tar.gz
gcc-c4ae9877307939806b3f161f55ce635002227bad.tar.bz2
atomic_base.h: Don't include <cstddef>, use nullptr.
2012-11-06 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/atomic_base.h: Don't include <cstddef>, use nullptr. * include/std/atomic: Likewise. * include/tr2/dynamic_bitset: Likewise. * libsupc++/vec.cc (compute_size(std::size_t, std::size_t, std::size_t)): Fix for -fno-exceptions. From-SVN: r193232
-rw-r--r--libstdc++-v3/ChangeLog9
-rw-r--r--libstdc++-v3/include/bits/atomic_base.h11
-rw-r--r--libstdc++-v3/include/std/atomic6
-rw-r--r--libstdc++-v3/include/tr2/dynamic_bitset1
-rw-r--r--libstdc++-v3/libsupc++/vec.cc9
5 files changed, 26 insertions, 10 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index e85de72..5a252ed 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,12 @@
+2012-11-06 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/atomic_base.h: Don't include <cstddef>, use nullptr.
+ * include/std/atomic: Likewise.
+ * include/tr2/dynamic_bitset: Likewise.
+
+ * libsupc++/vec.cc (compute_size(std::size_t, std::size_t,
+ std::size_t)): Fix for -fno-exceptions.
+
2012-11-06 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/profile/map.h (map::emplace_hint): Add missing return.
diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h
index af8a924..8ce5553 100644
--- a/libstdc++-v3/include/bits/atomic_base.h
+++ b/libstdc++-v3/include/bits/atomic_base.h
@@ -1,6 +1,6 @@
// -*- C++ -*- header.
-// Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+// Copyright (C) 2008-2012 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
@@ -35,7 +35,6 @@
#include <bits/c++config.h>
#include <stdbool.h>
#include <stdint.h>
-#include <cstddef>
#include <bits/atomic_lockfree_defines.h>
namespace std _GLIBCXX_VISIBILITY(default)
@@ -423,11 +422,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
bool
is_lock_free() const noexcept
- { return __atomic_is_lock_free(sizeof(_M_i), NULL); }
+ { return __atomic_is_lock_free(sizeof(_M_i), nullptr); }
bool
is_lock_free() const volatile noexcept
- { return __atomic_is_lock_free(sizeof(_M_i), NULL); }
+ { return __atomic_is_lock_free(sizeof(_M_i), nullptr); }
void
store(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept
@@ -717,11 +716,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
bool
is_lock_free() const noexcept
- { return __atomic_is_lock_free(_M_type_size(1), NULL); }
+ { return __atomic_is_lock_free(_M_type_size(1), nullptr); }
bool
is_lock_free() const volatile noexcept
- { return __atomic_is_lock_free(_M_type_size(1), NULL); }
+ { return __atomic_is_lock_free(_M_type_size(1), nullptr); }
void
store(__pointer_type __p,
diff --git a/libstdc++-v3/include/std/atomic b/libstdc++-v3/include/std/atomic
index 535a90f..4f9cd50 100644
--- a/libstdc++-v3/include/std/atomic
+++ b/libstdc++-v3/include/std/atomic
@@ -1,6 +1,6 @@
// -*- C++ -*- header.
-// Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+// Copyright (C) 2008-2012 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
@@ -184,11 +184,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
bool
is_lock_free() const noexcept
- { return __atomic_is_lock_free(sizeof(_M_i), NULL); }
+ { return __atomic_is_lock_free(sizeof(_M_i), nullptr); }
bool
is_lock_free() const volatile noexcept
- { return __atomic_is_lock_free(sizeof(_M_i), NULL); }
+ { return __atomic_is_lock_free(sizeof(_M_i), nullptr); }
void
store(_Tp __i, memory_order _m = memory_order_seq_cst) noexcept
diff --git a/libstdc++-v3/include/tr2/dynamic_bitset b/libstdc++-v3/include/tr2/dynamic_bitset
index 53b696f..5ea0ea5d 100644
--- a/libstdc++-v3/include/tr2/dynamic_bitset
+++ b/libstdc++-v3/include/tr2/dynamic_bitset
@@ -33,7 +33,6 @@
#include <limits>
#include <vector>
-#include <cstddef> // For size_t
#include <string>
#include <memory> // For std::allocator
#include <bits/functexcept.h> // For invalid_argument, out_of_range,
diff --git a/libstdc++-v3/libsupc++/vec.cc b/libstdc++-v3/libsupc++/vec.cc
index f9afd39..507514e 100644
--- a/libstdc++-v3/libsupc++/vec.cc
+++ b/libstdc++-v3/libsupc++/vec.cc
@@ -28,6 +28,7 @@
#include <cxxabi.h>
#include <new>
#include <exception>
+#include <cstdlib>
#include <bits/exception_defines.h>
#include "unwind-cxx.h"
@@ -65,10 +66,18 @@ namespace __cxxabiv1
std::size_t padding_size)
{
if (element_size && element_count > std::size_t(-1) / element_size)
+#ifdef __EXCEPTIONS
throw std::bad_alloc();
+#else
+ std::abort();
+#endif
std::size_t size = element_count * element_size;
if (size + padding_size < size)
+#ifdef __EXCEPTIONS
throw std::bad_alloc();
+#else
+ std::abort();
+#endif
return size + padding_size;
}
}