// initial part of a vtable, this structure is used with offsetof, so we don't
// have to keep alignments consistent manually.
struct vtable_prefix {
- __PTRDIFF_TYPE__ whole_object; // offset to most derived object
+ ptrdiff_t whole_object; // offset to most derived object
const __class_type_info *whole_type; // pointer to most derived type_info
const void *origin; // what a class's vptr points to
};
template <typename T>
inline const T *
-adjust_pointer (const void *base, __PTRDIFF_TYPE__ offset)
+adjust_pointer (const void *base, ptrdiff_t offset)
{
return reinterpret_cast <const T *>
(reinterpret_cast <const char *> (base) + offset);
// ADDR is a pointer to an object. Convert it to a pointer to a base,
// using OFFSET. IS_VIRTUAL is true, if we are getting a virtual base.
inline void const *
-convert_to_base (void const *addr, bool is_virtual, __PTRDIFF_TYPE__ offset)
+convert_to_base (void const *addr, bool is_virtual, ptrdiff_t offset)
{
if (is_virtual)
{
const void *vtable = *static_cast <const void *const *> (addr);
- offset = *adjust_pointer<__PTRDIFF_TYPE__> (vtable, offset);
+ offset = *adjust_pointer<ptrdiff_t> (vtable, offset);
}
return adjust_pointer<void> (addr, offset);
}
inline __class_type_info::__sub_kind __class_type_info::
-__find_public_src (__PTRDIFF_TYPE__ src2dst,
+__find_public_src (ptrdiff_t src2dst,
const void *obj_ptr,
const __class_type_info *src_type,
const void *src_ptr) const
}
__class_type_info::__sub_kind __class_type_info::
-__do_find_public_src (__PTRDIFF_TYPE__,
+__do_find_public_src (ptrdiff_t,
const void *obj_ptr,
const __class_type_info *,
const void *src_ptr) const
}
__class_type_info::__sub_kind __si_class_type_info::
-__do_find_public_src (__PTRDIFF_TYPE__ src2dst,
+__do_find_public_src (ptrdiff_t src2dst,
const void *obj_ptr,
const __class_type_info *src_type,
const void *src_ptr) const
}
__class_type_info::__sub_kind __vmi_class_type_info::
-__do_find_public_src (__PTRDIFF_TYPE__ src2dst,
+__do_find_public_src (ptrdiff_t src2dst,
const void *obj_ptr,
const __class_type_info *src_type,
const void *src_ptr) const
if (obj_ptr == src_ptr && *this == *src_type)
return __contained_public;
- for (__SIZE_TYPE__ i = vmi_base_count; i--;)
+ for (size_t i = vmi_base_count; i--;)
{
if (!vmi_bases[i].__is_public_p ())
continue; // Not public, can't be here.
const void *base = obj_ptr;
- __PTRDIFF_TYPE__ offset = vmi_bases[i].__offset ();
+ ptrdiff_t offset = vmi_bases[i].__offset ();
bool is_virtual = vmi_bases[i].__is_virtual_p ();
if (is_virtual)
}
bool __class_type_info::
-__do_dyncast (__PTRDIFF_TYPE__,
+__do_dyncast (ptrdiff_t,
__sub_kind access_path,
const __class_type_info *dst_type,
const void *obj_ptr,
}
bool __si_class_type_info::
-__do_dyncast (__PTRDIFF_TYPE__ src2dst,
+__do_dyncast (ptrdiff_t src2dst,
__sub_kind access_path,
const __class_type_info *dst_type,
const void *obj_ptr,
// work by filling in things lazily (when we know we need the information),
// and opportunisticly take early success or failure results.
bool __vmi_class_type_info::
-__do_dyncast (__PTRDIFF_TYPE__ src2dst,
+__do_dyncast (ptrdiff_t src2dst,
__sub_kind access_path,
const __class_type_info *dst_type,
const void *obj_ptr,
return false;
}
bool result_ambig = false;
- for (__SIZE_TYPE__ i = vmi_base_count; i--;)
+ for (size_t i = vmi_base_count; i--;)
{
__dyncast_result result2;
void const *base = obj_ptr;
__sub_kind base_access = access_path;
- __PTRDIFF_TYPE__ offset = vmi_bases[i].__offset ();
+ ptrdiff_t offset = vmi_bases[i].__offset ();
bool is_virtual = vmi_bases[i].__is_virtual_p ();
if (is_virtual)
if (src_details & __flags_unknown_mask)
src_details = vmi_flags;
- for (__SIZE_TYPE__ i = vmi_base_count; i--;)
+ for (size_t i = vmi_base_count; i--;)
{
__upcast_result result2 (src_details);
const void *base = obj_ptr;
__sub_kind sub_access = access_path;
- __PTRDIFF_TYPE__ offset = vmi_bases[i].__offset ();
+ ptrdiff_t offset = vmi_bases[i].__offset ();
bool is_virtual = vmi_bases[i].__is_virtual_p ();
if (!vmi_bases[i].__is_public_p ())
__dynamic_cast (const void *src_ptr, // object started from
const __class_type_info *src_type, // type of the starting object
const __class_type_info *dst_type, // desired target type
- __PTRDIFF_TYPE__ src2dst) // how src and dst are related
+ ptrdiff_t src2dst) // how src and dst are related
{
const void *vtable = *static_cast <const void *const *> (src_ptr);
const vtable_prefix *prefix =
- adjust_pointer <vtable_prefix>
- (vtable, -reinterpret_cast <__PTRDIFF_TYPE__>
- (&static_cast <vtable_prefix *> (NULL)->origin));
+ adjust_pointer <vtable_prefix> (vtable,
+ -offsetof (vtable_prefix, origin));
const void *whole_ptr =
adjust_pointer <void> (src_ptr, prefix->whole_object);
const __class_type_info *whole_type = prefix->whole_type;
/* allocate and construct array */
extern "C++" void *
-__cxa_vec_new (__SIZE_TYPE__ element_count,
- __SIZE_TYPE__ element_size,
- __SIZE_TYPE__ padding_size,
+__cxa_vec_new (size_t element_count,
+ size_t element_size,
+ size_t padding_size,
void (*constructor) (void *),
void (*destructor) (void *))
{
- __SIZE_TYPE__ size = element_count * element_size + padding_size;
+ size_t size = element_count * element_size + padding_size;
char *base = static_cast <char *> (operator new[] (size));
if (padding_size)
{
base += padding_size;
- reinterpret_cast <__SIZE_TYPE__ *> (base)[-1] = element_count;
+ reinterpret_cast <size_t *> (base)[-1] = element_count;
}
try
{
/* construct array */
extern "C++" void
__cxa_vec_ctor (void *array_address,
- __SIZE_TYPE__ element_count,
- __SIZE_TYPE__ element_size,
+ size_t element_count,
+ size_t element_size,
void (*constructor) (void *),
void (*destructor) (void *))
{
- __SIZE_TYPE__ ix = 0;
+ size_t ix = 0;
char *ptr = static_cast <char *> (array_address);
try
/* destruct array */
extern "C++" void
__cxa_vec_dtor (void *array_address,
- __SIZE_TYPE__ element_count,
- __SIZE_TYPE__ element_size,
+ size_t element_count,
+ size_t element_size,
void (*destructor) (void *))
{
if (destructor)
{
char *ptr = static_cast <char *> (array_address);
- __SIZE_TYPE__ ix = element_count;
+ size_t ix = element_count;
bool unwinding = std::uncaught_exception ();
ptr += element_count * element_size;
/* destruct and release array */
extern "C++" void
__cxa_vec_delete (void *array_address,
- __SIZE_TYPE__ element_size,
- __SIZE_TYPE__ padding_size,
+ size_t element_size,
+ size_t padding_size,
void (*destructor) (void *))
{
char *base = static_cast <char *> (array_address);
if (padding_size)
{
- __SIZE_TYPE__ element_count = reinterpret_cast <__SIZE_TYPE__ *> (base)[-1];
+ size_t element_count = reinterpret_cast <size_t *> (base)[-1];
base -= padding_size;
try
{