summaryrefslogtreecommitdiff
path: root/lang/perl5/patches
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-05-06 12:32:20 +0000
committerjlam <jlam@pkgsrc.org>2006-05-06 12:32:20 +0000
commita95ce22f2bc256037af8b96eacab00b54854a194 (patch)
tree7e1c51ade36fcb4d7bf192d170b438a38f2db8a4 /lang/perl5/patches
parentb867d23322d69bb46a1eae200c7d83bdfa4cf3d6 (diff)
downloadpkgsrc-a95ce22f2bc256037af8b96eacab00b54854a194.tar.gz
GCC versions prior to 3.4 have a bug handling the "unused" attribute
in declarations when compiling C++ code. Patch the perl.h and XSUB.h headers to avoid using this attribute if using GCC<3.4 and building C++ modules. This fixes PR pkg/33403 by OBATA Akio. Bump PKGREVISION to 2.
Diffstat (limited to 'lang/perl5/patches')
-rw-r--r--lang/perl5/patches/patch-aq26
-rw-r--r--lang/perl5/patches/patch-ar33
2 files changed, 59 insertions, 0 deletions
diff --git a/lang/perl5/patches/patch-aq b/lang/perl5/patches/patch-aq
new file mode 100644
index 00000000000..76765fc4106
--- /dev/null
+++ b/lang/perl5/patches/patch-aq
@@ -0,0 +1,26 @@
+$NetBSD: patch-aq,v 1.1 2006/05/06 12:32:20 jlam Exp $
+
+--- XSUB.h.orig 2006-01-02 09:45:29.000000000 -0500
++++ XSUB.h
+@@ -85,17 +85,16 @@ handled automatically by C<xsubpp>.
+ #ifndef PERL_UNUSED_VAR
+ # define PERL_UNUSED_VAR(x) ((void)x)
+ #endif
++#ifndef PERL_UNUSED_DECL
++# define PERL_UNUSED_DECL
++#endif
+
+ #define ST(off) PL_stack_base[ax + (off)]
+
+ #if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
+ # define XS(name) __declspec(dllexport) void name(pTHX_ CV* cv)
+ #else
+-# ifdef HASATTRIBUTE_UNUSED
+-# define XS(name) void name(pTHX_ CV* cv __attribute__unused__)
+-# else
+-# define XS(name) void name(pTHX_ CV* cv)
+-# endif
++# define XS(name) void name(pTHX_ CV* cv PERL_UNUSED_DECL)
+ #endif
+
+ #define dAX const I32 ax = MARK - PL_stack_base + 1
diff --git a/lang/perl5/patches/patch-ar b/lang/perl5/patches/patch-ar
new file mode 100644
index 00000000000..ddc939b25bd
--- /dev/null
+++ b/lang/perl5/patches/patch-ar
@@ -0,0 +1,33 @@
+$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