aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-20 03:34:34 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-20 03:34:34 +0000
commit9f3537b1472953a305cae7594a1c4f1b467bc1b7 (patch)
treef3762b4ac46634ef3afec98e24e0f62782097dca
parentef2391fedf31b818530d286fe896db9a50aeb390 (diff)
downloadpaludis-9f3537b1472953a305cae7594a1c4f1b467bc1b7.tar.gz
paludis-9f3537b1472953a305cae7594a1c4f1b467bc1b7.tar.xz
Fix attribute support on GCC 3.3. Don't try to use the weak linkage trick unless our compiler is known to provide a working __attribute__((weak)).
-rw-r--r--paludis/attributes.hh7
-rw-r--r--paludis/exception_to_debug_string.cc2
-rw-r--r--paludis/exception_to_debug_string.hh2
-rw-r--r--paludis/instantiation_policy.hh4
4 files changed, 13 insertions, 2 deletions
diff --git a/paludis/attributes.hh b/paludis/attributes.hh
index 074d61a..4027bb9 100644
--- a/paludis/attributes.hh
+++ b/paludis/attributes.hh
@@ -29,15 +29,22 @@
* discards its arguments.
*/
+/** \def PALUDIS_CAN_USE_ATTRIBUTE
+ * Defined if we can rely upon PALUDIS_ATTRIBUTE working (for example, for
+ * weak).
+ */
+
#ifdef __GNUC__
# if ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define PALUDIS_ATTRIBUTE(x) __attribute__(x)
+# define PALUDIS_CAN_USE_ATTRIBUTE 1
# else
# define PALUDIS_ATTRIBUTE(x)
# endif
#else
# ifdef __ICC
# define PALUDIS_ATTRIBUTE(x) __attribute__(x)
+# define PALUDIS_CAN_USE_ATTRIBUTE 1
# define nothrow
# define deprecated
# else
diff --git a/paludis/exception_to_debug_string.cc b/paludis/exception_to_debug_string.cc
index 5813260..05a76c6 100644
--- a/paludis/exception_to_debug_string.cc
+++ b/paludis/exception_to_debug_string.cc
@@ -23,6 +23,7 @@
using namespace paludis;
#ifdef PALUDIS_TEST_CASE
+#ifdef PALUDIS_CAN_USE_ATTRIBUTE
std::string exception_to_debug_string(const std::exception & e)
{
@@ -35,4 +36,5 @@ std::string exception_to_debug_string(const std::exception & e)
}
#endif
+#endif
diff --git a/paludis/exception_to_debug_string.hh b/paludis/exception_to_debug_string.hh
index f2c5373..a9c00ca 100644
--- a/paludis/exception_to_debug_string.hh
+++ b/paludis/exception_to_debug_string.hh
@@ -26,9 +26,11 @@
#include <exception>
#ifdef PALUDIS_TEST_CASE
+#ifdef PALUDIS_CAN_USE_ATTRIBUTE
std::string exception_to_debug_string(const std::exception & e);
#endif
+#endif
#endif
diff --git a/paludis/instantiation_policy.hh b/paludis/instantiation_policy.hh
index c4dbca9..dcf6aaa 100644
--- a/paludis/instantiation_policy.hh
+++ b/paludis/instantiation_policy.hh
@@ -99,13 +99,13 @@ namespace paludis
class InstantiationPolicy<OurType_, instantiation_method::NonInstantiableTag>
{
private:
- InstantiationPolicy();
-
InstantiationPolicy(const InstantiationPolicy &);
const InstantiationPolicy & operator= (const InstantiationPolicy &);
protected:
+ InstantiationPolicy();
+
~InstantiationPolicy()
{
}