$NetBSD: patch-ar,v 1.1 2006/05/06 12:32:20 jlam Exp $

--- perl.h.orig	2006-01-13 13:17:12.000000000 -0500
+++ perl.h
@@ -150,6 +150,15 @@ struct perl_thread;
 #  define CALLPROTECT CALL_FPTR(PL_protect)
 #endif
 
+/* GCC versions prior to 3.4 have a bug handling the "unused" attribute
+ * in declarations when compiling C++ code.
+ */
+#if defined(__GNUC__) && defined(__cplusplus)
+#  if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
+#    define PERL_UNUSED_DECL
+#  endif
+#endif
+
 #if defined(SYMBIAN) && defined(__GNUC__)
 #  ifdef __cplusplus
 #    define PERL_UNUSED_DECL
@@ -2375,7 +2384,11 @@ typedef struct clone_params CLONE_PARAMS
 #    define HASATTRIBUTE_PURE
 #  endif
 #  if __GNUC__ >= 3 /* gcc 3.0 -> */ /* XXX Verify this version */
-#    define HASATTRIBUTE_UNUSED
+#    if (__GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3) /* 3.4 -> */
+#      define HASATTRIBUTE_UNUSED
+#    elif !defined(__cplusplus)
+#      define HASATTRIBUTE_UNUSED
+#    endif
 #  endif
 #  if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 /* 3.4 -> */
 #    define HASATTRIBUTE_WARN_UNUSED_RESULT
