diff options
author | Karl Williamson <khw@cpan.org> | 2017-04-20 10:16:11 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-06-02 12:47:18 -0600 |
commit | 6a5bc5acd0f35a93138716f5c3681baa1e139c65 (patch) | |
tree | ce611dc3dd62d8e879ea0fe2c9bfe369733a916b | |
parent | b063b0a874bbc4724894885b0a633865675db9ff (diff) | |
download | perl-6a5bc5acd0f35a93138716f5c3681baa1e139c65.tar.gz |
Use new paradigm for hdr file double inclusion guard
We changed to use symbols not likely to be used by non-Perl code that
could conflict, and which have trailing underbars, so they don't look
like a regular Perl #define.
See https://rt.perl.org/Ticket/Display.html?id=131110
There are many more header files which are not guarded.
-rw-r--r-- | XSUB.h | 6 | ||||
-rw-r--r-- | dquote_inline.h | 6 | ||||
-rw-r--r-- | ebcdic_tables.h | 6 | ||||
-rw-r--r-- | handy.h | 6 | ||||
-rw-r--r-- | malloc_ctl.h | 4 | ||||
-rw-r--r-- | perlio.h | 6 | ||||
-rw-r--r-- | perliol.h | 6 | ||||
-rw-r--r-- | reentr.h | 4 | ||||
-rw-r--r-- | regcharclass.h | 8 | ||||
-rw-r--r-- | regen/ebcdic.pl | 6 | ||||
-rw-r--r-- | regen/reentr.pl | 4 | ||||
-rwxr-xr-x | regen/regcharclass.pl | 4 | ||||
-rw-r--r-- | regen/unicode_constants.pl | 6 | ||||
-rw-r--r-- | time64.h | 4 | ||||
-rw-r--r-- | time64_config.h | 6 | ||||
-rw-r--r-- | unicode_constants.h | 6 | ||||
-rw-r--r-- | utf8.h | 6 |
17 files changed, 47 insertions, 47 deletions
@@ -8,8 +8,8 @@ * */ -#ifndef _INC_PERL_XSUB_H -#define _INC_PERL_XSUB_H 1 +#ifndef PERL_XSUB_H_ +#define PERL_XSUB_H_ 1 /* first, some documentation for xsubpp-generated items */ @@ -703,7 +703,7 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">. # endif /* NO_XSLOCKS */ #endif /* PERL_IMPLICIT_SYS && !PERL_CORE */ -#endif /* _INC_PERL_XSUB_H */ /* include guard */ +#endif /* PERL_XSUB_H_ */ /* include guard */ /* * ex: set ts=8 sts=4 sw=4 et: diff --git a/dquote_inline.h b/dquote_inline.h index 1c7694d89f..f0ce9d6280 100644 --- a/dquote_inline.h +++ b/dquote_inline.h @@ -6,8 +6,8 @@ * License or the Artistic License, as specified in the README file. */ -#ifndef DQUOTE_INLINE_H /* Guard against nested #inclusion */ -#define DQUOTE_INLINE_H +#ifndef PERL_DQUOTE_INLINE_H_ /* Guard against nested #inclusion */ +#define PERL_DQUOTE_INLINE_H_ /* - regcurly - a little FSA that accepts {\d+,?\d*} @@ -64,4 +64,4 @@ S_form_short_octal_warning(pTHX_ (int) (s - sans_leading_zeros), sans_leading_zeros, *s); } -#endif /* DQUOTE_INLINE_H */ +#endif /* PERL_DQUOTE_INLINE_H_ */ diff --git a/ebcdic_tables.h b/ebcdic_tables.h index c36ab961f0..69ab372d11 100644 --- a/ebcdic_tables.h +++ b/ebcdic_tables.h @@ -5,8 +5,8 @@ */ -#ifndef H_EBCDIC_TABLES /* Guard against nested #includes */ -#define H_EBCDIC_TABLES 1 +#ifndef PERL_EBCDIC_TABLES_H_ /* Guard against nested #includes */ +#define PERL_EBCDIC_TABLES_H_ 1 /* This file contains definitions for various tables used in EBCDIC handling. * More info is in utfebcdic.h */ @@ -437,6 +437,6 @@ EXTCONST U8 PL_fold_latin1[] = { #endif /* EBCDIC 037 */ -#endif /* H_EBCDIC_TABLES */ +#endif /* PERL_EBCDIC_TABLES_H_ */ /* ex: set ro: */ @@ -11,8 +11,8 @@ /* IMPORTANT NOTE: Everything whose name begins with an underscore is for * internal core Perl use only. */ -#ifndef HANDY_H /* Guard against nested #inclusion */ -#define HANDY_H +#ifndef PERL_HANDY_H_ /* Guard against nested #inclusion */ +#define PERL_HANDY_H_ #if !defined(__STDC__) #ifdef NULL @@ -2521,7 +2521,7 @@ void Perl_mem_log_del_sv(const SV *sv, const char *filename, const int linenumbe #endif -#endif /* HANDY_H */ +#endif /* PERL_HANDY_H_ */ /* * ex: set ts=8 sts=4 sw=4 et: diff --git a/malloc_ctl.h b/malloc_ctl.h index d74637289b..0c72e9afcf 100644 --- a/malloc_ctl.h +++ b/malloc_ctl.h @@ -1,5 +1,5 @@ -#ifndef MALLOC_CTL_H -# define MALLOC_CTL_H +#ifndef PERL_MALLOC_CTL_H_ +# define PERL_MALLOC_CTL_H_ struct perl_mstats { UV *nfree; @@ -8,8 +8,8 @@ * */ -#ifndef _PERLIO_H -#define _PERLIO_H +#ifndef PERLIO_H_ +#define PERLIO_H_ /* Interface for perl to IO functions. There is a hierarchy of Configure determined #define controls: @@ -336,7 +336,7 @@ typedef struct PerlIO_list_s PerlIO_list_t; #endif END_EXTERN_C -#endif /* _PERLIO_H */ +#endif /* PERLIO_H_ */ /* * ex: set ts=8 sts=4 sw=4 et: @@ -1,5 +1,5 @@ -#ifndef _PERLIOL_H -#define _PERLIOL_H +#ifndef PERLIOL_H_ +#define PERLIOL_H_ typedef struct { PerlIO_funcs *funcs; @@ -286,7 +286,7 @@ PERL_CALLCONV SSize_t PerlIOUnix_write(pTHX_ PerlIO *f, const void *vbuf, Size /* Utf8 */ PERL_CALLCONV IV PerlIOUtf8_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab); -#endif /* _PERLIOL_H */ +#endif /* PERLIOL_H_ */ /* * ex: set ts=8 sts=4 sw=4 et: @@ -12,8 +12,8 @@ * Any changes made here will be lost! */ -#ifndef REENTR_H -#define REENTR_H +#ifndef PERL_REENTR_H_ +#define PERL_REENTR_H_ /* If compiling for a threaded perl, we will macro-wrap the system/library * interfaces (e.g. getpwent()) which have threaded versions diff --git a/regcharclass.h b/regcharclass.h index ff00207ec0..787957414c 100644 --- a/regcharclass.h +++ b/regcharclass.h @@ -15,8 +15,8 @@ */ -#ifndef H_REGCHARCLASS /* Guard against nested #includes */ -#define H_REGCHARCLASS 1 +#ifndef PERL_REGCHARCLASS_H_ /* Guard against nested #includes */ +#define PERL_REGCHARCLASS_H_ #if 'A' == 65 /* ASCII/Latin1 */ /* @@ -1851,7 +1851,7 @@ #endif /* EBCDIC 037 */ -#endif /* H_REGCHARCLASS */ +#endif /* PERL_REGCHARCLASS_H_ */ /* Generated from: * 59e717586b720a821ee0d7397679d5322e38b49f6fb7840545aedf669c733b70 lib/Unicode/UCD.pm @@ -1900,6 +1900,6 @@ * 717985d5fe0830f5b72ca21287a7d9f15ba6a383c29fbd3c47231d5f63edb68b lib/unicore/mktables * cdecb300baad839a6f62791229f551a4fa33f3cbdca08e378dc976466354e778 lib/unicore/version * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl - * c468aea5062ef84422219d74e83b6f3216f2823544b445f53ee1af71deeb2044 regen/regcharclass.pl + * 9ea6338945a7d70e5ea4b31ac7856c0b521df96be002e94b4b3b7d31debbf3ab regen/regcharclass.pl * 393f8d882713a3ba227351ad0f00ea4839fda74fcf77dcd1cdf31519925adba5 regen/regcharclass_multi_char_folds.pl * ex: set ro: */ diff --git a/regen/ebcdic.pl b/regen/ebcdic.pl index a3e049d2ad..5fd4ecda14 100644 --- a/regen/ebcdic.pl +++ b/regen/ebcdic.pl @@ -46,8 +46,8 @@ sub output_table ($$;$) { print $out_fh <<END; -#ifndef H_EBCDIC_TABLES /* Guard against nested #includes */ -#define H_EBCDIC_TABLES 1 +#ifndef PERL_EBCDIC_TABLES_H_ /* Guard against nested #includes */ +#define PERL_EBCDIC_TABLES_H_ 1 /* This file contains definitions for various tables used in EBCDIC handling. * More info is in utfebcdic.h */ @@ -222,6 +222,6 @@ END print $out_fh get_conditional_compile_line_end(); } -print $out_fh "\n#endif /* H_EBCDIC_TABLES */\n"; +print $out_fh "\n#endif /* PERL_EBCDIC_TABLES_H_ */\n"; read_only_bottom_close_and_rename($out_fh); diff --git a/regen/reentr.pl b/regen/reentr.pl index b73193ce56..1fc14e21ca 100644 --- a/regen/reentr.pl +++ b/regen/reentr.pl @@ -62,8 +62,8 @@ sub open_print_header { my $h = open_print_header('reentr.h'); print $h <<EOF; -#ifndef REENTR_H -#define REENTR_H +#ifndef PERL_REENTR_H_ +#define PERL_REENTR_H_ /* If compiling for a threaded perl, we will macro-wrap the system/library * interfaces (e.g. getpwent()) which have threaded versions diff --git a/regen/regcharclass.pl b/regen/regcharclass.pl index 510fb8931d..83925e19d5 100755 --- a/regen/regcharclass.pl +++ b/regen/regcharclass.pl @@ -1364,7 +1364,7 @@ WARNING: These macros are for internal Perl core use only, and may be changed or removed without notice. EOF ); - print $out_fh "\n#ifndef H_REGCHARCLASS /* Guard against nested #includes */\n#define H_REGCHARCLASS 1\n"; + print $out_fh "\n#ifndef PERL_REGCHARCLASS_H_ /* Guard against nested #includes */\n#define PERL_REGCHARCLASS_H_\n"; my ( $op, $title, @txt, @types, %mods ); my $doit= sub ($) { @@ -1452,7 +1452,7 @@ EOF print $out_fh get_conditional_compile_line_end(); } - print $out_fh "\n#endif /* H_REGCHARCLASS */\n"; + print $out_fh "\n#endif /* PERL_REGCHARCLASS_H_ */\n"; if($path eq '-') { print $out_fh "/* ex: set ro: */\n"; diff --git a/regen/unicode_constants.pl b/regen/unicode_constants.pl index cbe317926c..64ae84a649 100644 --- a/regen/unicode_constants.pl +++ b/regen/unicode_constants.pl @@ -12,8 +12,8 @@ my $out_fh = open_new('unicode_constants.h', '>', print $out_fh <<END; -#ifndef H_UNICODE_CONSTANTS /* Guard against nested #includes */ -#define H_UNICODE_CONSTANTS 1 +#ifndef PERL_UNICODE_CONSTANTS_H_ /* Guard against nested #includes */ +#define PERL_UNICODE_CONSTANTS_H_ 1 /* This file contains #defines for the version of Unicode being used and * various Unicode code points. The values the code point macros expand to @@ -198,7 +198,7 @@ if (@cwcm) { } } -print $out_fh "\n#endif /* H_UNICODE_CONSTANTS */\n"; +print $out_fh "\n#endif /* PERL_UNICODE_CONSTANTS_H_ */\n"; read_only_bottom_close_and_rename($out_fh); @@ -1,8 +1,8 @@ #include <time.h> #include "time64_config.h" -#ifndef TIME64_H -# define TIME64_H +#ifndef PERL_TIME64_H_ +# define PERL_TIME64_H_ /* Set our custom types */ diff --git a/time64_config.h b/time64_config.h index 42cc12c88e..0bebebb53c 100644 --- a/time64_config.h +++ b/time64_config.h @@ -1,5 +1,5 @@ -#ifndef TIME64_CONFIG_H -# define TIME64_CONFIG_H +#ifndef PERL_TIME64_CONFIG_H_ +# define PERL_TIME64_CONFIG_H_ /* Configuration ------------- @@ -82,4 +82,4 @@ #define SYSTEM_GMTIME_MAX CAT2(GMTIME_MAX,.0) #define SYSTEM_GMTIME_MIN CAT2(GMTIME_MIN,.0) -#endif /* TIME64_CONFIG_H */ +#endif /* PERL_TIME64_CONFIG_H_ */ diff --git a/unicode_constants.h b/unicode_constants.h index 1c0e62e356..318b9015ae 100644 --- a/unicode_constants.h +++ b/unicode_constants.h @@ -5,8 +5,8 @@ */ -#ifndef H_UNICODE_CONSTANTS /* Guard against nested #includes */ -#define H_UNICODE_CONSTANTS 1 +#ifndef PERL_UNICODE_CONSTANTS_H_ /* Guard against nested #includes */ +#define PERL_UNICODE_CONSTANTS_H_ 1 /* This file contains #defines for the version of Unicode being used and * various Unicode code points. The values the code point macros expand to @@ -182,6 +182,6 @@ bytes. /* The highest code point that has any type of case change */ #define HIGHEST_CASE_CHANGING_CP_FOR_USE_ONLY_BY_UTF8_DOT_C 0x1E943 -#endif /* H_UNICODE_CONSTANTS */ +#endif /* PERL_UNICODE_CONSTANTS_H_ */ /* ex: set ro: */ @@ -14,8 +14,8 @@ * */ -#ifndef H_UTF8 /* Guard against recursive inclusion */ -#define H_UTF8 1 +#ifndef PERL_UTF8_H_ /* Guard against recursive inclusion */ +#define PERL_UTF8_H_ 1 /* Use UTF-8 as the default script encoding? * Turning this on will break scripts having non-UTF-8 binary @@ -1169,7 +1169,7 @@ L</is_utf8_string_loclen_flags> to check entire strings. * retained solely for backwards compatibility */ #define IS_UTF8_CHAR(p, n) (isUTF8_CHAR(p, (p) + (n)) == n) -#endif /* H_UTF8 */ +#endif /* PERL_UTF8_H_ */ /* * ex: set ts=8 sts=4 sw=4 et: |