aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/inc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2000-05-07 09:40:34 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2000-05-07 09:40:34 +0000
commit9ad3ca3499c4c5e9153e29de70cb4fef9ac6188c (patch)
tree1781cf47889914cf9db55ba456955d522bfecec8 /gcc/cp/inc
parentb8f4101008cbcf1f0c3f38f90a71616b5edc6950 (diff)
downloadgcc-9ad3ca3499c4c5e9153e29de70cb4fef9ac6188c.zip
gcc-9ad3ca3499c4c5e9153e29de70cb4fef9ac6188c.tar.gz
gcc-9ad3ca3499c4c5e9153e29de70cb4fef9ac6188c.tar.bz2
cxxabi.h: Use __SIZE_TYPE_ and __PTRDIFF_TYPE__ in place of std::size_t and...
* inc/cxxabi.h: Use __SIZE_TYPE_ and __PTRDIFF_TYPE__ in place of std::size_t and std::ptrdiff_t respectively. * tinfo.cc: Likewise. * vec.cc: Likewise. From-SVN: r33759
Diffstat (limited to 'gcc/cp/inc')
-rw-r--r--gcc/cp/inc/cxxabi.h48
1 files changed, 26 insertions, 22 deletions
diff --git a/gcc/cp/inc/cxxabi.h b/gcc/cp/inc/cxxabi.h
index 959d23f..9bda484 100644
--- a/gcc/cp/inc/cxxabi.h
+++ b/gcc/cp/inc/cxxabi.h
@@ -49,10 +49,14 @@
#ifdef __cplusplus
+// We use the compiler builtins __SIZE__TYPE__ and __PTRDIFF_TYPE__ instead of
+// std::size_t and std::ptrdiff_t respectively. This makes us independant of
+// the conformance level of <cstddef> and whether -fhonor-std was supplied.
+// <cstddef> is not currently available during compiler building anyway.
+// including <stddef.h> would be wrong, as that would rudely place size_t in
+// the global namespace.
+
#include <typeinfo>
-// This should really be cstddef, but that currently is not available when
-// building the runtime.
-#include <stddef.h>
namespace __cxxabiv1
{
@@ -207,11 +211,11 @@ public:
{ return vmi_offset_flags & virtual_mask; }
bool __is_public_p () const
{ return vmi_offset_flags & public_mask; }
- std::ptrdiff_t __offset () const
+ __PTRDIFF_TYPE__ __offset () const
{
// This shift, being of a signed type, is implementation defined. GCC
// implements such shifts as arithmetic, which is what we want.
- return std::ptrdiff_t (vmi_offset_flags) >> offset_shift;
+ return __PTRDIFF_TYPE__ (vmi_offset_flags) >> offset_shift;
}
};
@@ -277,7 +281,7 @@ public:
within this type. If SRC_PTR is one of our SRC_TYPE bases, indicate the
virtuality. Returns not_contained for non containment or private
containment. */
- inline __sub_kind __find_public_src (std::ptrdiff_t __src2dst,
+ inline __sub_kind __find_public_src (__PTRDIFF_TYPE__ __src2dst,
const void *__obj_ptr,
const __class_type_info *__src_type,
const void *__src_ptr) const;
@@ -289,7 +293,7 @@ public:
indicates the static type started from and SRC_PTR points to that base
within the most derived object. Fill in RESULT with what we find. Return
true if we have located an ambiguous match. */
- virtual bool __do_dyncast (std::ptrdiff_t __src2dst,
+ virtual bool __do_dyncast (__PTRDIFF_TYPE__ __src2dst,
__sub_kind __access_path,
const __class_type_info *__dst_type,
const void *__obj_ptr,
@@ -301,7 +305,7 @@ public:
inherited by the type started from -- which is not necessarily the
current type. The current type will be a base of the destination type.
OBJ_PTR points to the current base. */
- virtual __sub_kind __do_find_public_src (std::ptrdiff_t __src2dst,
+ virtual __sub_kind __do_find_public_src (__PTRDIFF_TYPE__ __src2dst,
const void *__obj_ptr,
const __class_type_info *__src_type,
const void *__src_ptr) const;
@@ -326,14 +330,14 @@ public:
/* implementation defined member functions */
protected:
- virtual bool __do_dyncast (std::ptrdiff_t __src2dst,
+ virtual bool __do_dyncast (__PTRDIFF_TYPE__ __src2dst,
__sub_kind __access_path,
const __class_type_info *__dst_type,
const void *__obj_ptr,
const __class_type_info *__src_type,
const void *__src_ptr,
__dyncast_result &__result) const;
- virtual __sub_kind __do_find_public_src (std::ptrdiff_t __src2dst,
+ virtual __sub_kind __do_find_public_src (__PTRDIFF_TYPE__ __src2dst,
const void *__obj_ptr,
const __class_type_info *__src_type,
const void *__sub_ptr) const;
@@ -376,14 +380,14 @@ public:
/* implementation defined member functions */
protected:
- virtual bool __do_dyncast (std::ptrdiff_t __src2dst,
+ virtual bool __do_dyncast (__PTRDIFF_TYPE__ __src2dst,
__sub_kind __access_path,
const __class_type_info *__dst_type,
const void *__obj_ptr,
const __class_type_info *__src_type,
const void *__src_ptr,
__dyncast_result &__result) const;
- virtual __sub_kind __do_find_public_src (std::ptrdiff_t __src2dst,
+ virtual __sub_kind __do_find_public_src (__PTRDIFF_TYPE__ __src2dst,
const void *__obj_ptr,
const __class_type_info *__src_type,
const void *__src_ptr) const;
@@ -398,7 +402,7 @@ extern "C++"
void *__dynamic_cast (const void *__src_ptr, /* object started from */
const __class_type_info *__src_type, /* static type of object */
const __class_type_info *__dst_type, /* desired target type */
- std::ptrdiff_t __src2dst); /* how src and dst are related */
+ __PTRDIFF_TYPE__ __src2dst); /* how src and dst are related */
/* src2dst has the following possible values
>= 0: src_type is a unique public non-virtual base of dst_type
@@ -411,32 +415,32 @@ void *__dynamic_cast (const void *__src_ptr, /* object started from */
/* allocate and construct array */
extern "C++"
-void *__cxa_vec_new (size_t __element_count,
- size_t __element_size,
- size_t __padding_size,
+void *__cxa_vec_new (__SIZE_TYPE__ __element_count,
+ __SIZE_TYPE__ __element_size,
+ __SIZE_TYPE__ __padding_size,
void (*__constructor) (void *),
void (*__destructor) (void *));
/* construct array */
extern "C++"
void __cxa_vec_ctor (void *__array_address,
- size_t __element_count,
- size_t __element_size,
+ __SIZE_TYPE__ __element_count,
+ __SIZE_TYPE__ __element_size,
void (*__constructor) (void *),
void (*__destructor) (void *));
/* destruct array */
extern "C++"
void __cxa_vec_dtor (void *__array_address,
- size_t __element_count,
- size_t __element_size,
+ __SIZE_TYPE__ __element_count,
+ __SIZE_TYPE__ __element_size,
void (*__destructor) (void *));
/* destruct and release array */
extern "C++"
void __cxa_vec_delete (void *__array_address,
- size_t __element_size,
- size_t __padding_size,
+ __SIZE_TYPE__ __element_size,
+ __SIZE_TYPE__ __padding_size,
void (*__destructor) (void *));
} /* namespace __cxxabiv1 */