aboutsummaryrefslogtreecommitdiff
path: root/gold/object.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2006-09-29 22:34:01 +0000
committerIan Lance Taylor <iant@google.com>2006-09-29 22:34:01 +0000
commit5482377ddc6d4104399a7e2e49518a6e893dca65 (patch)
tree17d8018e5b63b67fee207053404b8479c00f6843 /gold/object.h
parent61ba1cf93601b0a0877a8ade94ba3c674a09f77e (diff)
downloadgdb-5482377ddc6d4104399a7e2e49518a6e893dca65.zip
gdb-5482377ddc6d4104399a7e2e49518a6e893dca65.tar.gz
gdb-5482377ddc6d4104399a7e2e49518a6e893dca65.tar.bz2
Clean up HAVE_MEMBER_TEMPLATE_SPECIFICATIONS somewhat.
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: