aboutsummaryrefslogtreecommitdiff
path: root/gold/object.h
diff options
context:
space:
mode:
Diffstat (limited to 'gold/object.h')
-rw-r--r--gold/object.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/gold/object.h b/gold/object.h
index 198e015..cea0f06 100644
--- a/gold/object.h
+++ b/gold/object.h
@@ -85,14 +85,12 @@ class Object
is_locked() const
{ return this->input_file_->file().is_locked(); }
-#ifdef HAVE_MEMBER_TEMPLATE_SPECIFICATIONS
// Return the sized target structure associated with this object.
// This is like the target method but it returns a pointer of
// appropriate checked type.
template<int size, bool big_endian>
Sized_target<size, big_endian>*
- sized_target();
-#endif
+ sized_target(ACCEPT_SIZE_ENDIAN_ONLY);
// Read the symbol and relocation information.
Read_symbols_data
@@ -232,22 +230,18 @@ class Object
std::vector<Map_to_output> map_to_output_;
};
-#ifdef HAVE_MEMBER_TEMPLATE_SPECIFICATIONS
-
// Implement sized_target inline for efficiency. This approach breaks
// static type checking, but is made safe using asserts.
template<int size, bool big_endian>
inline Sized_target<size, big_endian>*
-Object::sized_target()
+Object::sized_target(ACCEPT_SIZE_ENDIAN_ONLY)
{
assert(this->target_->get_size() == size);
assert(this->target_->is_big_endian() ? big_endian : !big_endian);
return static_cast<Sized_target<size, big_endian>*>(this->target_);
}
-#endif
-
// A regular object file. This is size and endian specific.
template<int size, bool big_endian>
@@ -288,11 +282,8 @@ class Sized_object : public Object
Sized_target<size, big_endian>*
sized_target()
{
-#ifdef HAVE_MEMBER_TEMPLATE_SPECIFICATIONS
- return this->Object::sized_target<size, big_endian>();
-#else
- return static_cast<Sized_target<size, big_endian>*>(this->target());
-#endif
+ return this->Object::sized_target SELECT_SIZE_ENDIAN_NAME (
+ SELECT_SIZE_ENDIAN_ONLY(size, big_endian));
}
private: