This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Provide header guards to prevent re-inclusion
authorJames E Keenan <jkeenan@cpan.org>
Thu, 29 Nov 2018 03:50:29 +0000 (22:50 -0500)
committerJames E Keenan <jkeenan@cpan.org>
Wed, 5 Dec 2018 02:39:19 +0000 (21:39 -0500)
Per LGTM analysis: https://lgtm.com/projects/g/Perl/perl5/alerts/?mode=tree&ruleFocus=2163210746

and LGTM recommendation: https://lgtm.com/rules/2163210746/

For: RT 133699

feature.h
invlist_inline.h
regcomp.h
regen/feature.pl

index 52ace09..3877e16 100644 (file)
--- a/feature.h
+++ b/feature.h
@@ -5,6 +5,9 @@
  */
 
 
+#ifndef PERL_FEATURE_H_
+#define PERL_FEATURE_H_
+
 #if defined(PERL_CORE) || defined (PERL_EXT)
 
 #define HINT_FEATURE_SHIFT     26
@@ -162,4 +165,6 @@ S_enable_feature_bundle(pTHX_ SV *ver)
 }
 #endif /* PERL_IN_OP_C */
 
+#endif /* PERL_FEATURE_H_ */
+
 /* ex: set ro: */
index 48084d3..cd002ce 100644 (file)
@@ -6,6 +6,9 @@
  *    License or the Artistic License, as specified in the README file.
  */
 
+#ifndef PERL_INVLIST_INLINE_H_
+#define PERL_INVLIST_INLINE_H_
+
 #if defined(PERL_IN_UTF8_C) || defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_TOKE_C)
 
 /* An element is in an inversion list iff its index is even numbered: 0, 2, 4,
@@ -93,3 +96,5 @@ S_invlist_array(SV* const invlist)
 #   endif
 
 #endif
+
+#endif /* PERL_INVLIST_INLINE_H_ */
index 923058b..c76edd7 100644 (file)
--- a/regcomp.h
+++ b/regcomp.h
@@ -7,6 +7,10 @@
  *    License or the Artistic License, as specified in the README file.
  *
  */
+
+#ifndef PERL_REGCOMP_H_
+#define PERL_REGCOMP_H_
+
 #include "regcharclass.h"
 
 /* Convert branch sequences to more efficient trie ops? */
@@ -1118,6 +1122,8 @@ typedef enum {
        WB_BOUND
 } bound_type;
 
+#endif /* PERL_REGCOMP_H_ */
+
 /*
  * ex: set ts=8 sts=4 sw=4 et:
  */
index 89d46af..12bf5a8 100755 (executable)
@@ -242,6 +242,9 @@ read_only_bottom_close_and_rename($pm);
 
 print $h <<EOH;
 
+#ifndef PERL_FEATURE_H_
+#define PERL_FEATURE_H_
+
 #if defined(PERL_CORE) || defined (PERL_EXT)
 
 #define HINT_FEATURE_SHIFT     $HintShift
@@ -364,6 +367,8 @@ print $h <<EOJ;
     else                           PL_hints &= ~HINT_UNI_8_BIT;
 }
 #endif /* PERL_IN_OP_C */
+
+#endif /* PERL_FEATURE_H_ */
 EOJ
 
 read_only_bottom_close_and_rename($h);