From 5482377ddc6d4104399a7e2e49518a6e893dca65 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 29 Sep 2006 22:34:01 +0000 Subject: Clean up HAVE_MEMBER_TEMPLATE_SPECIFICATIONS somewhat. --- gold/object.h | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'gold/object.h') diff --git a/gold/object.h b/gold/object.h index 198e0153016..cea0f06a8f7 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 Sized_target* - 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_; }; -#ifdef HAVE_MEMBER_TEMPLATE_SPECIFICATIONS - // Implement sized_target inline for efficiency. This approach breaks // static type checking, but is made safe using asserts. template inline Sized_target* -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*>(this->target_); } -#endif - // A regular object file. This is size and endian specific. template @@ -288,11 +282,8 @@ class Sized_object : public Object Sized_target* sized_target() { -#ifdef HAVE_MEMBER_TEMPLATE_SPECIFICATIONS - return this->Object::sized_target(); -#else - return static_cast*>(this->target()); -#endif + return this->Object::sized_target SELECT_SIZE_ENDIAN_NAME ( + SELECT_SIZE_ENDIAN_ONLY(size, big_endian)); } private: -- cgit v1.2.1