This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
g++ dNOOP (luckily one can mix code and decls in C++)
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 1 Aug 2006 08:46:15 +0000 (11:46 +0300)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Tue, 1 Aug 2006 12:13:53 +0000 (12:13 +0000)
Somewhat modifies as per Steve Hay's comment
Message-Id: <200608010546.k715kEdP017064@kosh.hut.fi>

p4raw-id: //depot/perl@28639

perl.h

diff --git a/perl.h b/perl.h
index ef558a4..3c806e3 100644 (file)
--- a/perl.h
+++ b/perl.h
 #endif
 
 #define NOOP /*EMPTY*/(void)0
+#if !defined(HASATTRIBUTE_UNUSED) && defined(__cplusplus)
+#define dNOOP /*EMPTY*/(void)0 /* Older g++ has no __attribute((unused))__ */
+#else
 #define dNOOP extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL
+#endif
 
 #ifndef pTHX
 /* Don't bother defining tTHX and sTHX; using them outside