regcomp.c: don't include INTERN.h
authorDavid Mitchell <davem@iabyn.com>
Wed, 26 Dec 2018 20:50:16 +0000 (20:50 +0000)
committerDavid Mitchell <davem@iabyn.com>
Tue, 19 Feb 2019 13:28:12 +0000 (13:28 +0000)
This file only needs including by globals.c; it was being included
in regcomp.c too as the declarations in regcomp.h aren't included by
perl.h and thus don't get pulled into globals.c.  This was a confusing
and hacky workaround.

Instead, this commit causes globals.c to #include regcomp.h directly

After this commit, only globals.c #includes INTERN.h

globals.c
regcomp.c

index 14a53a4..8d6f2b1 100644 (file)
--- a/globals.c
+++ b/globals.c
 
 #include "perlapi.h"           /* bring in PL_force_link_funcs */
 
+/* regcomp.h * isn't #included in perl.h, as its only included within a
+ * few specific files such as regcomp.c, regexec.c.  So include it
+ * explicitly to process any data declarations within it.
+ */
+#include "regcomp.h"
+
+
 /*
  * ex: set ts=8 sts=4 sw=4 et:
  */
index f79e157..5bae668 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
 #define PERL_IN_REGCOMP_C
 #include "perl.h"
 
-#ifndef PERL_IN_XSUB_RE
-#  include "INTERN.h"
-#endif
-
 #define REG_COMP_C
 #ifdef PERL_IN_XSUB_RE
 #  include "re_comp.h"