integrate #18366-18370 from maint-5.8:
Hugo van der Sanden [Tue, 21 Jan 2003 01:52:49 +0000 (01:52 +0000)]
Implement the CPP namespace protection from [perl #8610];
unless a function has an 'A' flag, it's defined only if
PERL_CORE.  (Why do we have so many many functions with an
'A' flag, is another matter.)  (The number of #ifdef PERL_COREs
could be cut down further by having a state variable and
inserting #ifdefs and #endifs when the state flips.)

Caught by change #18366; thanks to the re extension we have some
functions that are file static but yet part of "the public API"...
Maybe a new class of exportability (a new embed.fnc flag) is
required for this case.

Continue on change #18367; implement the said flag, 'E'.
(Some nm output studying was needed to get the right set
of re symbols defined.)

In AIX (strict symbol exports) the cxinc is needed for List::Util.
p4raw-link: @18367 on //depot/maint-5.8/perl: 6f21c313c98cc4764e09fbbce2c8792576c90d7d
p4raw-link: @18366 on //depot/maint-5.8/perl: 704f60d9cfa8683df64f005e872b37aea8f9d60e

p4raw-id: //depot/perl@18531

embed.fnc
embed.h
embed.pl
ext/re/Makefile.PL
global.sym

index d8cf699..4394eba 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -17,6 +17,7 @@
 :       o              has no compatibility macro (#define foo Perl_foo)
 :       x              not exported
 :       M              may change
+:       E              visible to Perl core extensions
 :
 : Individual flags may be separated by whitespace.
 :
@@ -140,7 +141,7 @@ Ap  |char** |get_op_names
 p      |char*  |get_no_modify
 p      |U32*   |get_opargs
 Ap     |PPADDR_t*|get_ppaddr
-p      |I32    |cxinc
+Ap     |I32    |cxinc
 Afp    |void   |deb            |const char* pat|...
 Ap     |void   |vdeb           |const char* pat|va_list* args
 Ap     |void   |debprofdump
@@ -605,7 +606,7 @@ Ap  |I32    |regexec_flags  |regexp* prog|char* stringarg \
                                |char* strend|char* strbeg|I32 minend \
                                |SV* screamer|void* data|U32 flags
 Ap     |regnode*|regnext       |regnode* p
-p      |void   |regprop        |SV* sv|regnode* o
+Ep     |void   |regprop        |SV* sv|regnode* o
 Ap     |void   |repeatcpy      |char* to|const char* from|I32 len|I32 count
 Ap     |char*  |rninstr        |const char* big|const char* bigend \
                                |const char* little|const char* lend
@@ -1092,60 +1093,60 @@ s       |int    |dooneliner     |char *cmd|char *filename
 #endif
 
 #if defined(PERL_IN_REGCOMP_C) || defined(PERL_DECL_PROT)
-s      |regnode*|reg           |struct RExC_state_t*|I32|I32 *
-s      |regnode*|reganode      |struct RExC_state_t*|U8|U32
-s      |regnode*|regatom       |struct RExC_state_t*|I32 *
-s      |regnode*|regbranch     |struct RExC_state_t*|I32 *|I32
-s      |void   |reguni         |struct RExC_state_t*|UV|char *|STRLEN*
-s      |regnode*|regclass      |struct RExC_state_t*
-s      |I32    |regcurly       |char *
-s      |regnode*|reg_node      |struct RExC_state_t*|U8
-s      |regnode*|regpiece      |struct RExC_state_t*|I32 *
-s      |void   |reginsert      |struct RExC_state_t*|U8|regnode *
-s      |void   |regoptail      |struct RExC_state_t*|regnode *|regnode *
-s      |void   |regtail        |struct RExC_state_t*|regnode *|regnode *
-s      |char*|regwhite |char *|char *
-s      |char*|nextchar |struct RExC_state_t*
+Es     |regnode*|reg           |struct RExC_state_t*|I32|I32 *
+Es     |regnode*|reganode      |struct RExC_state_t*|U8|U32
+Es     |regnode*|regatom       |struct RExC_state_t*|I32 *
+Es     |regnode*|regbranch     |struct RExC_state_t*|I32 *|I32
+Es     |void   |reguni         |struct RExC_state_t*|UV|char *|STRLEN*
+Es     |regnode*|regclass      |struct RExC_state_t*
+Es     |I32    |regcurly       |char *
+Es     |regnode*|reg_node      |struct RExC_state_t*|U8
+Es     |regnode*|regpiece      |struct RExC_state_t*|I32 *
+Es     |void   |reginsert      |struct RExC_state_t*|U8|regnode *
+Es     |void   |regoptail      |struct RExC_state_t*|regnode *|regnode *
+Es     |void   |regtail        |struct RExC_state_t*|regnode *|regnode *
+Es     |char*|regwhite |char *|char *
+Es     |char*|nextchar |struct RExC_state_t*
 #  ifdef DEBUGGING
-s      |regnode*|dumpuntil     |regnode *start|regnode *node \
+Es     |regnode*|dumpuntil     |regnode *start|regnode *node \
                                |regnode *last|SV* sv|I32 l
-s      |void   |put_byte       |SV* sv|int c
+Es     |void   |put_byte       |SV* sv|int c
 #  endif
-s      |void   |scan_commit    |struct RExC_state_t*|struct scan_data_t *data
-s      |void   |cl_anything    |struct RExC_state_t*|struct regnode_charclass_class *cl
-s      |int    |cl_is_anything |struct regnode_charclass_class *cl
-s      |void   |cl_init        |struct RExC_state_t*|struct regnode_charclass_class *cl
-s      |void   |cl_init_zero   |struct RExC_state_t*|struct regnode_charclass_class *cl
-s      |void   |cl_and         |struct regnode_charclass_class *cl \
+Es     |void   |scan_commit    |struct RExC_state_t*|struct scan_data_t *data
+Es     |void   |cl_anything    |struct RExC_state_t*|struct regnode_charclass_class *cl
+Es     |int    |cl_is_anything |struct regnode_charclass_class *cl
+Es     |void   |cl_init        |struct RExC_state_t*|struct regnode_charclass_class *cl
+Es     |void   |cl_init_zero   |struct RExC_state_t*|struct regnode_charclass_class *cl
+Es     |void   |cl_and         |struct regnode_charclass_class *cl \
                                |struct regnode_charclass_class *and_with
-s      |void   |cl_or          |struct RExC_state_t*|struct regnode_charclass_class *cl \
+Es     |void   |cl_or          |struct RExC_state_t*|struct regnode_charclass_class *cl \
                                |struct regnode_charclass_class *or_with
-s      |I32    |study_chunk    |struct RExC_state_t*|regnode **scanp|I32 *deltap \
+Es     |I32    |study_chunk    |struct RExC_state_t*|regnode **scanp|I32 *deltap \
                                |regnode *last|struct scan_data_t *data \
                                |U32 flags
-s      |I32    |add_data       |struct RExC_state_t*|I32 n|char *s
+Es     |I32    |add_data       |struct RExC_state_t*|I32 n|char *s
 rs     |void|re_croak2 |const char* pat1|const char* pat2|...
-s      |I32    |regpposixcc    |struct RExC_state_t*|I32 value
-s      |void   |checkposixcc   |struct RExC_state_t*
+Es     |I32    |regpposixcc    |struct RExC_state_t*|I32 value
+Es     |void   |checkposixcc   |struct RExC_state_t*
 #endif
 
 #if defined(PERL_IN_REGEXEC_C) || defined(PERL_DECL_PROT)
-s      |I32    |regmatch       |regnode *prog
-s      |I32    |regrepeat      |regnode *p|I32 max
-s      |I32    |regrepeat_hard |regnode *p|I32 max|I32 *lp
-s      |I32    |regtry         |regexp *prog|char *startpos
-s      |bool   |reginclass     |regnode *n|U8 *p|STRLEN *lenp|bool do_utf8sv_is_utf8
-s      |CHECKPOINT|regcppush   |I32 parenfloor
-s      |char*|regcppop
-s      |char*|regcp_set_to     |I32 ss
-s      |void   |cache_re       |regexp *prog
-s      |U8*    |reghop         |U8 *pos|I32 off
-s      |U8*    |reghop3        |U8 *pos|I32 off|U8 *lim
-s      |U8*    |reghopmaybe    |U8 *pos|I32 off
-s      |U8*    |reghopmaybe3   |U8 *pos|I32 off|U8 *lim
-s      |char*  |find_byclass   |regexp * prog|regnode *c|char *s|char *strend|char *startpos|I32 norun
-s      |void   |to_utf8_substr |regexp * prog
-s      |void   |to_byte_substr |regexp * prog
+Es     |I32    |regmatch       |regnode *prog
+Es     |I32    |regrepeat      |regnode *p|I32 max
+Es     |I32    |regrepeat_hard |regnode *p|I32 max|I32 *lp
+Es     |I32    |regtry         |regexp *prog|char *startpos
+Es     |bool   |reginclass     |regnode *n|U8 *p|STRLEN *lenp|bool do_utf8sv_is_utf8
+Es     |CHECKPOINT|regcppush   |I32 parenfloor
+Es     |char*|regcppop
+Es     |char*|regcp_set_to     |I32 ss
+Es     |void   |cache_re       |regexp *prog
+Es     |U8*    |reghop         |U8 *pos|I32 off
+Es     |U8*    |reghop3        |U8 *pos|I32 off|U8 *lim
+Es     |U8*    |reghopmaybe    |U8 *pos|I32 off
+Es     |U8*    |reghopmaybe3   |U8 *pos|I32 off|U8 *lim
+Es     |char*  |find_byclass   |regexp * prog|regnode *c|char *s|char *strend|char *startpos|I32 norun
+Es     |void   |to_utf8_substr |regexp * prog
+Es     |void   |to_byte_substr |regexp * prog
 #endif
 
 #if defined(PERL_IN_DUMP_C) || defined(PERL_DECL_PROT)
diff --git a/embed.h b/embed.h
index ac4f87c..2325d12 100644 (file)
--- a/embed.h
+++ b/embed.h
 #  endif
 #endif
 #if defined(MYMALLOC)
+#ifdef PERL_CORE
 #define malloced_size          Perl_malloced_size
 #endif
+#endif
 #define get_context            Perl_get_context
 #define set_context            Perl_set_context
 #define amagic_call            Perl_amagic_call
 #define Gv_AMupdate            Perl_Gv_AMupdate
 #define gv_handler             Perl_gv_handler
+#ifdef PERL_CORE
 #define append_elem            Perl_append_elem
+#endif
+#ifdef PERL_CORE
 #define append_list            Perl_append_list
+#endif
+#ifdef PERL_CORE
 #define apply                  Perl_apply
+#endif
 #define apply_attrs_string     Perl_apply_attrs_string
 #define av_clear               Perl_av_clear
 #define av_delete              Perl_av_delete
 #define av_exists              Perl_av_exists
 #define av_extend              Perl_av_extend
+#ifdef PERL_CORE
 #define av_fake                        Perl_av_fake
+#endif
 #define av_fetch               Perl_av_fetch
 #define av_fill                        Perl_av_fill
 #define av_len                 Perl_av_len
 #define av_make                        Perl_av_make
 #define av_pop                 Perl_av_pop
 #define av_push                        Perl_av_push
+#ifdef PERL_CORE
 #define av_reify               Perl_av_reify
+#endif
 #define av_shift               Perl_av_shift
 #define av_store               Perl_av_store
 #define av_undef               Perl_av_undef
 #define av_unshift             Perl_av_unshift
+#ifdef PERL_CORE
 #define bind_match             Perl_bind_match
+#endif
+#ifdef PERL_CORE
 #define block_end              Perl_block_end
+#endif
 #define block_gimme            Perl_block_gimme
+#ifdef PERL_CORE
 #define block_start            Perl_block_start
+#endif
+#ifdef PERL_CORE
 #define boot_core_UNIVERSAL    Perl_boot_core_UNIVERSAL
+#endif
+#ifdef PERL_CORE
 #define boot_core_PerlIO       Perl_boot_core_PerlIO
+#endif
 #define call_list              Perl_call_list
+#ifdef PERL_CORE
 #define cando                  Perl_cando
+#endif
 #define cast_ulong             Perl_cast_ulong
 #define cast_i32               Perl_cast_i32
 #define cast_iv                        Perl_cast_iv
@@ -71,7 +95,9 @@
 #if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP)
 #define my_chsize              Perl_my_chsize
 #endif
+#ifdef PERL_CORE
 #define convert                        Perl_convert
+#endif
 #define croak                  Perl_croak
 #define vcroak                 Perl_vcroak
 #if defined(PERL_IMPLICIT_CONTEXT)
 #define fprintf_nocontext      Perl_fprintf_nocontext
 #define printf_nocontext       Perl_printf_nocontext
 #endif
+#ifdef PERL_CORE
 #define cv_ckproto             Perl_cv_ckproto
+#endif
+#ifdef PERL_CORE
 #define cv_clone               Perl_cv_clone
+#endif
 #define cv_const_sv            Perl_cv_const_sv
+#ifdef PERL_CORE
 #define op_const_sv            Perl_op_const_sv
+#endif
 #define cv_undef               Perl_cv_undef
 #define cx_dump                        Perl_cx_dump
 #define filter_add             Perl_filter_add
 #define filter_read            Perl_filter_read
 #define get_op_descs           Perl_get_op_descs
 #define get_op_names           Perl_get_op_names
+#ifdef PERL_CORE
 #define get_no_modify          Perl_get_no_modify
+#endif
+#ifdef PERL_CORE
 #define get_opargs             Perl_get_opargs
+#endif
 #define get_ppaddr             Perl_get_ppaddr
 #define cxinc                  Perl_cxinc
 #define deb                    Perl_deb
 #define debstack               Perl_debstack
 #define debstackptrs           Perl_debstackptrs
 #define delimcpy               Perl_delimcpy
+#ifdef PERL_CORE
 #define deprecate              Perl_deprecate
+#endif
+#ifdef PERL_CORE
 #define deprecate_old          Perl_deprecate_old
+#endif
 #define die                    Perl_die
+#ifdef PERL_CORE
 #define vdie                   Perl_vdie
+#endif
+#ifdef PERL_CORE
 #define die_where              Perl_die_where
+#endif
 #define dounwind               Perl_dounwind
+#ifdef PERL_CORE
 #define do_aexec               Perl_do_aexec
+#endif
+#ifdef PERL_CORE
 #define do_aexec5              Perl_do_aexec5
+#endif
 #define do_binmode             Perl_do_binmode
+#ifdef PERL_CORE
 #define do_chop                        Perl_do_chop
+#endif
 #define do_close               Perl_do_close
+#ifdef PERL_CORE
 #define do_eof                 Perl_do_eof
+#endif
+#ifdef PERL_CORE
 #define do_exec                        Perl_do_exec
+#endif
 #if defined(WIN32)
 #define do_aspawn              Perl_do_aspawn
 #define do_spawn               Perl_do_spawn
 #define do_spawn_nowait                Perl_do_spawn_nowait
 #endif
 #if !defined(WIN32)
+#ifdef PERL_CORE
 #define do_exec3               Perl_do_exec3
 #endif
+#endif
+#ifdef PERL_CORE
 #define do_execfree            Perl_do_execfree
+#endif
 #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
+#ifdef PERL_CORE
 #define do_ipcctl              Perl_do_ipcctl
+#endif
+#ifdef PERL_CORE
 #define do_ipcget              Perl_do_ipcget
+#endif
+#ifdef PERL_CORE
 #define do_msgrcv              Perl_do_msgrcv
+#endif
+#ifdef PERL_CORE
 #define do_msgsnd              Perl_do_msgsnd
+#endif
+#ifdef PERL_CORE
 #define do_semop               Perl_do_semop
+#endif
+#ifdef PERL_CORE
 #define do_shmio               Perl_do_shmio
 #endif
+#endif
 #define do_join                        Perl_do_join
+#ifdef PERL_CORE
 #define do_kv                  Perl_do_kv
+#endif
 #define do_open                        Perl_do_open
 #define do_open9               Perl_do_open9
 #define do_openn               Perl_do_openn
+#ifdef PERL_CORE
 #define do_pipe                        Perl_do_pipe
+#endif
+#ifdef PERL_CORE
 #define do_print               Perl_do_print
+#endif
+#ifdef PERL_CORE
 #define do_readline            Perl_do_readline
+#endif
+#ifdef PERL_CORE
 #define do_chomp               Perl_do_chomp
+#endif
+#ifdef PERL_CORE
 #define do_seek                        Perl_do_seek
+#endif
 #define do_sprintf             Perl_do_sprintf
+#ifdef PERL_CORE
 #define do_sysseek             Perl_do_sysseek
+#endif
+#ifdef PERL_CORE
 #define do_tell                        Perl_do_tell
+#endif
+#ifdef PERL_CORE
 #define do_trans               Perl_do_trans
+#endif
+#ifdef PERL_CORE
 #define do_vecget              Perl_do_vecget
+#endif
+#ifdef PERL_CORE
 #define do_vecset              Perl_do_vecset
+#endif
+#ifdef PERL_CORE
 #define do_vop                 Perl_do_vop
+#endif
+#ifdef PERL_CORE
 #define dofile                 Perl_dofile
+#endif
 #define dowantarray            Perl_dowantarray
 #define dump_all               Perl_dump_all
 #define dump_eval              Perl_dump_eval
 #define dump_sub               Perl_dump_sub
 #define fbm_compile            Perl_fbm_compile
 #define fbm_instr              Perl_fbm_instr
+#ifdef PERL_CORE
 #define find_script            Perl_find_script
+#endif
+#ifdef PERL_CORE
 #define force_list             Perl_force_list
+#endif
+#ifdef PERL_CORE
 #define fold_constants         Perl_fold_constants
+#endif
 #define form                   Perl_form
 #define vform                  Perl_vform
 #define free_tmps              Perl_free_tmps
+#ifdef PERL_CORE
 #define gen_constant_list      Perl_gen_constant_list
+#endif
 #if !defined(HAS_GETENV_LEN)
+#ifdef PERL_CORE
 #define getenv_len             Perl_getenv_len
 #endif
+#endif
 #define gp_free                        Perl_gp_free
 #define gp_ref                 Perl_gp_ref
 #define gv_AVadd               Perl_gv_AVadd
 #define ibcmp                  Perl_ibcmp
 #define ibcmp_locale           Perl_ibcmp_locale
 #define ibcmp_utf8             Perl_ibcmp_utf8
+#ifdef PERL_CORE
 #define ingroup                        Perl_ingroup
+#endif
+#ifdef PERL_CORE
 #define init_argv_symbols      Perl_init_argv_symbols
+#endif
+#ifdef PERL_CORE
 #define init_debugger          Perl_init_debugger
+#endif
 #define init_stacks            Perl_init_stacks
 #define init_tm                        Perl_init_tm
+#ifdef PERL_CORE
 #define intro_my               Perl_intro_my
+#endif
 #define instr                  Perl_instr
+#ifdef PERL_CORE
 #define io_close               Perl_io_close
+#endif
+#ifdef PERL_CORE
 #define invert                 Perl_invert
+#endif
+#ifdef PERL_CORE
 #define is_gv_magical          Perl_is_gv_magical
+#endif
 #define is_lvalue_sub          Perl_is_lvalue_sub
 #define to_uni_upper_lc                Perl_to_uni_upper_lc
 #define to_uni_title_lc                Perl_to_uni_title_lc
 #define is_utf8_punct          Perl_is_utf8_punct
 #define is_utf8_xdigit         Perl_is_utf8_xdigit
 #define is_utf8_mark           Perl_is_utf8_mark
+#ifdef PERL_CORE
 #define jmaybe                 Perl_jmaybe
+#endif
+#ifdef PERL_CORE
 #define keyword                        Perl_keyword
+#endif
 #define leave_scope            Perl_leave_scope
+#ifdef PERL_CORE
 #define lex_end                        Perl_lex_end
+#endif
+#ifdef PERL_CORE
 #define lex_start              Perl_lex_start
+#endif
 #define op_null                        Perl_op_null
+#ifdef PERL_CORE
 #define op_clear               Perl_op_clear
+#endif
+#ifdef PERL_CORE
 #define linklist               Perl_linklist
+#endif
+#ifdef PERL_CORE
 #define list                   Perl_list
+#endif
+#ifdef PERL_CORE
 #define listkids               Perl_listkids
+#endif
 #define load_module            Perl_load_module
 #define vload_module           Perl_vload_module
+#ifdef PERL_CORE
 #define localize               Perl_localize
+#endif
 #define looks_like_number      Perl_looks_like_number
 #define grok_bin               Perl_grok_bin
 #define grok_hex               Perl_grok_hex
 #define grok_number            Perl_grok_number
 #define grok_numeric_radix     Perl_grok_numeric_radix
 #define grok_oct               Perl_grok_oct
+#ifdef PERL_CORE
 #define magic_clearenv         Perl_magic_clearenv
+#endif
+#ifdef PERL_CORE
 #define magic_clear_all_env    Perl_magic_clear_all_env
+#endif
+#ifdef PERL_CORE
 #define magic_clearpack                Perl_magic_clearpack
+#endif
+#ifdef PERL_CORE
 #define magic_clearsig         Perl_magic_clearsig
+#endif
+#ifdef PERL_CORE
 #define magic_existspack       Perl_magic_existspack
+#endif
+#ifdef PERL_CORE
 #define magic_freeregexp       Perl_magic_freeregexp
+#endif
+#ifdef PERL_CORE
 #define magic_freeovrld                Perl_magic_freeovrld
+#endif
+#ifdef PERL_CORE
 #define magic_get              Perl_magic_get
+#endif
+#ifdef PERL_CORE
 #define magic_getarylen                Perl_magic_getarylen
+#endif
+#ifdef PERL_CORE
 #define magic_getdefelem       Perl_magic_getdefelem
+#endif
+#ifdef PERL_CORE
 #define magic_getglob          Perl_magic_getglob
+#endif
+#ifdef PERL_CORE
 #define magic_getnkeys         Perl_magic_getnkeys
+#endif
+#ifdef PERL_CORE
 #define magic_getpack          Perl_magic_getpack
+#endif
+#ifdef PERL_CORE
 #define magic_getpos           Perl_magic_getpos
+#endif
+#ifdef PERL_CORE
 #define magic_getsig           Perl_magic_getsig
+#endif
+#ifdef PERL_CORE
 #define magic_getsubstr                Perl_magic_getsubstr
+#endif
+#ifdef PERL_CORE
 #define magic_gettaint         Perl_magic_gettaint
+#endif
+#ifdef PERL_CORE
 #define magic_getuvar          Perl_magic_getuvar
+#endif
+#ifdef PERL_CORE
 #define magic_getvec           Perl_magic_getvec
+#endif
+#ifdef PERL_CORE
 #define magic_len              Perl_magic_len
+#endif
+#ifdef PERL_CORE
 #define magic_nextpack         Perl_magic_nextpack
+#endif
+#ifdef PERL_CORE
 #define magic_regdata_cnt      Perl_magic_regdata_cnt
+#endif
+#ifdef PERL_CORE
 #define magic_regdatum_get     Perl_magic_regdatum_get
+#endif
+#ifdef PERL_CORE
 #define magic_regdatum_set     Perl_magic_regdatum_set
+#endif
+#ifdef PERL_CORE
 #define magic_set              Perl_magic_set
+#endif
+#ifdef PERL_CORE
 #define magic_setamagic                Perl_magic_setamagic
+#endif
+#ifdef PERL_CORE
 #define magic_setarylen                Perl_magic_setarylen
+#endif
+#ifdef PERL_CORE
 #define magic_setbm            Perl_magic_setbm
+#endif
+#ifdef PERL_CORE
 #define magic_setdbline                Perl_magic_setdbline
+#endif
 #if defined(USE_LOCALE_COLLATE)
+#ifdef PERL_CORE
 #define magic_setcollxfrm      Perl_magic_setcollxfrm
 #endif
+#endif
+#ifdef PERL_CORE
 #define magic_setdefelem       Perl_magic_setdefelem
+#endif
+#ifdef PERL_CORE
 #define magic_setenv           Perl_magic_setenv
+#endif
+#ifdef PERL_CORE
 #define magic_setfm            Perl_magic_setfm
+#endif
+#ifdef PERL_CORE
 #define magic_setisa           Perl_magic_setisa
+#endif
+#ifdef PERL_CORE
 #define magic_setglob          Perl_magic_setglob
+#endif
+#ifdef PERL_CORE
 #define magic_setmglob         Perl_magic_setmglob
+#endif
+#ifdef PERL_CORE
 #define magic_setnkeys         Perl_magic_setnkeys
+#endif
+#ifdef PERL_CORE
 #define magic_setpack          Perl_magic_setpack
+#endif
+#ifdef PERL_CORE
 #define magic_setpos           Perl_magic_setpos
+#endif
+#ifdef PERL_CORE
 #define magic_setsig           Perl_magic_setsig
+#endif
+#ifdef PERL_CORE
 #define magic_setsubstr                Perl_magic_setsubstr
+#endif
+#ifdef PERL_CORE
 #define magic_settaint         Perl_magic_settaint
+#endif
+#ifdef PERL_CORE
 #define magic_setuvar          Perl_magic_setuvar
+#endif
+#ifdef PERL_CORE
 #define magic_setvec           Perl_magic_setvec
+#endif
+#ifdef PERL_CORE
 #define magic_setutf8          Perl_magic_setutf8
+#endif
+#ifdef PERL_CORE
 #define magic_set_all_env      Perl_magic_set_all_env
+#endif
+#ifdef PERL_CORE
 #define magic_sizepack         Perl_magic_sizepack
+#endif
+#ifdef PERL_CORE
 #define magic_wipepack         Perl_magic_wipepack
+#endif
+#ifdef PERL_CORE
 #define magicname              Perl_magicname
+#endif
 #define markstack_grow         Perl_markstack_grow
 #if defined(USE_LOCALE_COLLATE)
+#ifdef PERL_CORE
 #define mem_collxfrm           Perl_mem_collxfrm
 #endif
+#endif
 #define mess                   Perl_mess
 #define vmess                  Perl_vmess
+#ifdef PERL_CORE
 #define qerror                 Perl_qerror
+#endif
 #define sortsv                 Perl_sortsv
 #define mg_clear               Perl_mg_clear
 #define mg_copy                        Perl_mg_copy
 #define mg_set                 Perl_mg_set
 #define mg_size                        Perl_mg_size
 #define mini_mktime            Perl_mini_mktime
+#ifdef PERL_CORE
 #define mod                    Perl_mod
+#endif
+#ifdef PERL_CORE
 #define mode_from_discipline   Perl_mode_from_discipline
+#endif
 #define moreswitches           Perl_moreswitches
+#ifdef PERL_CORE
 #define my                     Perl_my
+#endif
 #define my_atof                        Perl_my_atof
 #if (!defined(HAS_MEMCPY) && !defined(HAS_BCOPY)) || (!defined(HAS_MEMMOVE) && !defined(HAS_SAFE_MEMCPY) && !defined(HAS_SAFE_BCOPY))
 #define my_bcopy               Perl_my_bcopy
 #define my_htonl               Perl_my_htonl
 #define my_ntohl               Perl_my_ntohl
 #endif
+#ifdef PERL_CORE
 #define my_unexec              Perl_my_unexec
+#endif
 #define newANONLIST            Perl_newANONLIST
 #define newANONHASH            Perl_newANONHASH
 #define newANONSUB             Perl_newANONSUB
 #define vnumify                        Perl_vnumify
 #define vstringify             Perl_vstringify
 #define vcmp                   Perl_vcmp
+#ifdef PERL_CORE
 #define nextargv               Perl_nextargv
+#endif
 #define ninstr                 Perl_ninstr
+#ifdef PERL_CORE
 #define oopsCV                 Perl_oopsCV
+#endif
 #define op_free                        Perl_op_free
+#ifdef PERL_CORE
 #define package                        Perl_package
+#endif
+#ifdef PERL_CORE
 #define pad_alloc              Perl_pad_alloc
+#endif
+#ifdef PERL_CORE
 #define allocmy                        Perl_allocmy
+#endif
+#ifdef PERL_CORE
 #define pad_findmy             Perl_pad_findmy
+#endif
+#ifdef PERL_CORE
 #define oopsAV                 Perl_oopsAV
+#endif
+#ifdef PERL_CORE
 #define oopsHV                 Perl_oopsHV
+#endif
+#ifdef PERL_CORE
 #define pad_leavemy            Perl_pad_leavemy
+#endif
 #define pad_sv                 Perl_pad_sv
+#ifdef PERL_CORE
 #define pad_free               Perl_pad_free
+#endif
+#ifdef PERL_CORE
 #define pad_reset              Perl_pad_reset
+#endif
+#ifdef PERL_CORE
 #define pad_swipe              Perl_pad_swipe
+#endif
+#ifdef PERL_CORE
 #define peep                   Perl_peep
+#endif
+#ifdef PERL_CORE
+#endif
 #if defined(USE_REENTRANT_API)
 #define reentrant_size         Perl_reentrant_size
 #define reentrant_init         Perl_reentrant_init
 #define set_numeric_standard   Perl_set_numeric_standard
 #define require_pv             Perl_require_pv
 #define pack_cat               Perl_pack_cat
+#ifdef PERL_CORE
 #define pidgone                        Perl_pidgone
+#endif
 #define pmflag                 Perl_pmflag
+#ifdef PERL_CORE
 #define pmruntime              Perl_pmruntime
+#endif
+#ifdef PERL_CORE
 #define pmtrans                        Perl_pmtrans
+#endif
+#ifdef PERL_CORE
 #define pop_return             Perl_pop_return
+#endif
 #define pop_scope              Perl_pop_scope
+#ifdef PERL_CORE
 #define prepend_elem           Perl_prepend_elem
+#endif
+#ifdef PERL_CORE
 #define push_return            Perl_push_return
+#endif
 #define push_scope             Perl_push_scope
+#ifdef PERL_CORE
 #define ref                    Perl_ref
+#endif
+#ifdef PERL_CORE
 #define refkids                        Perl_refkids
+#endif
 #define regdump                        Perl_regdump
 #define regclass_swash         Perl_regclass_swash
 #define pregexec               Perl_pregexec
 #define re_intuit_string       Perl_re_intuit_string
 #define regexec_flags          Perl_regexec_flags
 #define regnext                        Perl_regnext
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regprop                        Perl_regprop
+#endif
 #define repeatcpy              Perl_repeatcpy
 #define rninstr                        Perl_rninstr
 #define rsignal                        Perl_rsignal
+#ifdef PERL_CORE
 #define rsignal_restore                Perl_rsignal_restore
+#endif
+#ifdef PERL_CORE
 #define rsignal_save           Perl_rsignal_save
+#endif
 #define rsignal_state          Perl_rsignal_state
+#ifdef PERL_CORE
 #define rxres_free             Perl_rxres_free
+#endif
+#ifdef PERL_CORE
 #define rxres_restore          Perl_rxres_restore
+#endif
+#ifdef PERL_CORE
 #define rxres_save             Perl_rxres_save
+#endif
 #if !defined(HAS_RENAME)
+#ifdef PERL_CORE
 #define same_dirent            Perl_same_dirent
 #endif
+#endif
 #define savepv                 Perl_savepv
 #define savesharedpv           Perl_savesharedpv
 #define savepvn                        Perl_savepvn
 #define save_destructor                Perl_save_destructor
 #define save_destructor_x      Perl_save_destructor_x
 #define save_freesv            Perl_save_freesv
+#ifdef PERL_CORE
 #define save_freeop            Perl_save_freeop
+#endif
 #define save_freepv            Perl_save_freepv
 #define save_generic_svref     Perl_save_generic_svref
 #define save_generic_pvref     Perl_save_generic_pvref
 #define save_long              Perl_save_long
 #define save_mortalizesv       Perl_save_mortalizesv
 #define save_nogv              Perl_save_nogv
+#ifdef PERL_CORE
 #define save_op                        Perl_save_op
+#endif
 #define save_scalar            Perl_save_scalar
 #define save_pptr              Perl_save_pptr
 #define save_vptr              Perl_save_vptr
 #define save_sptr              Perl_save_sptr
 #define save_svref             Perl_save_svref
 #define save_threadsv          Perl_save_threadsv
+#ifdef PERL_CORE
 #define sawparens              Perl_sawparens
+#endif
+#ifdef PERL_CORE
 #define scalar                 Perl_scalar
+#endif
+#ifdef PERL_CORE
 #define scalarkids             Perl_scalarkids
+#endif
+#ifdef PERL_CORE
 #define scalarseq              Perl_scalarseq
+#endif
+#ifdef PERL_CORE
 #define scalarvoid             Perl_scalarvoid
+#endif
 #define scan_bin               Perl_scan_bin
 #define scan_hex               Perl_scan_hex
 #define scan_num               Perl_scan_num
 #define scan_oct               Perl_scan_oct
+#ifdef PERL_CORE
 #define scope                  Perl_scope
+#endif
 #define screaminstr            Perl_screaminstr
 #if !defined(VMS)
+#ifdef PERL_CORE
 #define setenv_getix           Perl_setenv_getix
 #endif
+#endif
+#ifdef PERL_CORE
 #define setdefout              Perl_setdefout
+#endif
+#ifdef PERL_CORE
 #define share_hek              Perl_share_hek
+#endif
+#ifdef PERL_CORE
 #define sighandler             Perl_sighandler
+#endif
 #define stack_grow             Perl_stack_grow
 #define start_subparse         Perl_start_subparse
+#ifdef PERL_CORE
 #define sub_crush_depth                Perl_sub_crush_depth
+#endif
 #define sv_2bool               Perl_sv_2bool
 #define sv_2cv                 Perl_sv_2cv
 #define sv_2io                 Perl_sv_2io
 #define sv_pvutf8n             Perl_sv_pvutf8n
 #define sv_pvbyten             Perl_sv_pvbyten
 #define sv_true                        Perl_sv_true
+#ifdef PERL_CORE
 #define sv_add_arena           Perl_sv_add_arena
+#endif
 #define sv_backoff             Perl_sv_backoff
 #define sv_bless               Perl_sv_bless
 #define sv_catpvf              Perl_sv_catpvf
 #define sv_vcatpvf             Perl_sv_vcatpvf
 #define sv_catpv               Perl_sv_catpv
 #define sv_chop                        Perl_sv_chop
+#ifdef PERL_CORE
 #define sv_clean_all           Perl_sv_clean_all
+#endif
+#ifdef PERL_CORE
 #define sv_clean_objs          Perl_sv_clean_objs
+#endif
 #define sv_clear               Perl_sv_clear
 #define sv_cmp                 Perl_sv_cmp
 #define sv_cmp_locale          Perl_sv_cmp_locale
 #define sv_derived_from                Perl_sv_derived_from
 #define sv_eq                  Perl_sv_eq
 #define sv_free                        Perl_sv_free
+#ifdef PERL_CORE
 #define sv_free_arenas         Perl_sv_free_arenas
+#endif
 #define sv_gets                        Perl_sv_gets
 #define sv_grow                        Perl_sv_grow
 #define sv_inc                 Perl_sv_inc
 #endif
 #define unpack_str             Perl_unpack_str
 #define unsharepvn             Perl_unsharepvn
+#ifdef PERL_CORE
 #define unshare_hek            Perl_unshare_hek
+#endif
+#ifdef PERL_CORE
 #define utilize                        Perl_utilize
+#endif
 #define utf16_to_utf8          Perl_utf16_to_utf8
 #define utf16_to_utf8_reversed Perl_utf16_to_utf8_reversed
 #define utf8_length            Perl_utf8_length
 #define uvuni_to_utf8_flags    Perl_uvuni_to_utf8_flags
 #define pv_uni_display         Perl_pv_uni_display
 #define sv_uni_display         Perl_sv_uni_display
+#ifdef PERL_CORE
 #define vivify_defelem         Perl_vivify_defelem
+#endif
+#ifdef PERL_CORE
 #define vivify_ref             Perl_vivify_ref
+#endif
+#ifdef PERL_CORE
 #define wait4pid               Perl_wait4pid
+#endif
+#ifdef PERL_CORE
 #define report_evil_fh         Perl_report_evil_fh
+#endif
+#ifdef PERL_CORE
 #define report_uninit          Perl_report_uninit
+#endif
 #define warn                   Perl_warn
 #define vwarn                  Perl_vwarn
 #define warner                 Perl_warner
 #define vwarner                        Perl_vwarner
+#ifdef PERL_CORE
 #define watch                  Perl_watch
+#endif
 #define whichsig               Perl_whichsig
+#ifdef PERL_CORE
 #define yyerror                        Perl_yyerror
+#endif
 #ifdef USE_PURE_BISON
+#ifdef PERL_CORE
 #define yylex_r                        Perl_yylex_r
 #endif
+#endif
+#ifdef PERL_CORE
 #define yylex                  Perl_yylex
+#endif
+#ifdef PERL_CORE
 #define yyparse                        Perl_yyparse
+#endif
+#ifdef PERL_CORE
 #define yywarn                 Perl_yywarn
+#endif
 #if defined(MYMALLOC)
 #define dump_mstats            Perl_dump_mstats
 #define get_mstats             Perl_get_mstats
 #define sv_force_normal_flags  Perl_sv_force_normal_flags
 #define tmps_grow              Perl_tmps_grow
 #define sv_rvweaken            Perl_sv_rvweaken
+#ifdef PERL_CORE
 #define magic_killbackrefs     Perl_magic_killbackrefs
+#endif
 #define newANONATTRSUB         Perl_newANONATTRSUB
 #define newATTRSUB             Perl_newATTRSUB
 #define newMYSUB               Perl_newMYSUB
+#ifdef PERL_CORE
 #define my_attrs               Perl_my_attrs
+#endif
+#ifdef PERL_CORE
 #define boot_core_xsutils      Perl_boot_core_xsutils
+#endif
 #if defined(USE_ITHREADS)
 #define cx_dup                 Perl_cx_dup
 #define si_dup                 Perl_si_dup
 #define custom_op_name         Perl_custom_op_name
 #define custom_op_desc         Perl_custom_op_desc
 #if defined(PERL_COPY_ON_WRITE)
+#ifdef PERL_CORE
 #define sv_release_IVX         Perl_sv_release_IVX
 #endif
+#endif
 #define sv_nosharing           Perl_sv_nosharing
 #define sv_nolocking           Perl_sv_nolocking
 #define sv_nounlocking         Perl_sv_nounlocking
 #define nothreadhook           Perl_nothreadhook
 #if defined(PERL_IN_DOOP_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define do_trans_simple                S_do_trans_simple
+#endif
+#ifdef PERL_CORE
 #define do_trans_count         S_do_trans_count
+#endif
+#ifdef PERL_CORE
 #define do_trans_complex       S_do_trans_complex
+#endif
+#ifdef PERL_CORE
 #define do_trans_simple_utf8   S_do_trans_simple_utf8
+#endif
+#ifdef PERL_CORE
 #define do_trans_count_utf8    S_do_trans_count_utf8
+#endif
+#ifdef PERL_CORE
 #define do_trans_complex_utf8  S_do_trans_complex_utf8
 #endif
+#endif
 #if defined(PERL_IN_GV_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define gv_init_sv             S_gv_init_sv
+#endif
+#ifdef PERL_CORE
 #define require_errno          S_require_errno
 #endif
+#endif
 #if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define hsplit                 S_hsplit
+#endif
+#ifdef PERL_CORE
 #define hfreeentries           S_hfreeentries
+#endif
+#ifdef PERL_CORE
 #define more_he                        S_more_he
+#endif
+#ifdef PERL_CORE
 #define new_he                 S_new_he
+#endif
+#ifdef PERL_CORE
 #define del_he                 S_del_he
+#endif
+#ifdef PERL_CORE
 #define save_hek_flags         S_save_hek_flags
+#endif
+#ifdef PERL_CORE
 #define hv_magic_check         S_hv_magic_check
+#endif
+#ifdef PERL_CORE
 #define unshare_hek_or_pvn     S_unshare_hek_or_pvn
+#endif
+#ifdef PERL_CORE
 #define share_hek_flags                S_share_hek_flags
+#endif
+#ifdef PERL_CORE
 #define hv_fetch_flags         S_hv_fetch_flags
+#endif
+#ifdef PERL_CORE
 #define hv_notallowed          S_hv_notallowed
 #endif
+#endif
 #if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define save_magic             S_save_magic
+#endif
+#ifdef PERL_CORE
 #define magic_methpack         S_magic_methpack
+#endif
+#ifdef PERL_CORE
 #define magic_methcall         S_magic_methcall
 #endif
+#endif
 #if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define list_assignment                S_list_assignment
+#endif
+#ifdef PERL_CORE
 #define bad_type               S_bad_type
+#endif
+#ifdef PERL_CORE
 #define cop_free               S_cop_free
+#endif
+#ifdef PERL_CORE
 #define modkids                        S_modkids
+#endif
+#ifdef PERL_CORE
 #define no_bareword_allowed    S_no_bareword_allowed
+#endif
+#ifdef PERL_CORE
 #define no_fh_allowed          S_no_fh_allowed
+#endif
+#ifdef PERL_CORE
 #define scalarboolean          S_scalarboolean
+#endif
+#ifdef PERL_CORE
 #define too_few_arguments      S_too_few_arguments
+#endif
+#ifdef PERL_CORE
 #define too_many_arguments     S_too_many_arguments
+#endif
+#ifdef PERL_CORE
 #define newDEFSVOP             S_newDEFSVOP
+#endif
+#ifdef PERL_CORE
 #define new_logop              S_new_logop
+#endif
+#ifdef PERL_CORE
 #define simplify_sort          S_simplify_sort
+#endif
+#ifdef PERL_CORE
 #define is_handle_constructor  S_is_handle_constructor
+#endif
+#ifdef PERL_CORE
 #define gv_ename               S_gv_ename
+#endif
+#ifdef PERL_CORE
 #define scalar_mod_type                S_scalar_mod_type
+#endif
+#ifdef PERL_CORE
 #define my_kid                 S_my_kid
+#endif
+#ifdef PERL_CORE
 #define dup_attrlist           S_dup_attrlist
+#endif
+#ifdef PERL_CORE
 #define apply_attrs            S_apply_attrs
+#endif
+#ifdef PERL_CORE
 #define apply_attrs_my         S_apply_attrs_my
+#endif
 #  if defined(PL_OP_SLAB_ALLOC)
+#ifdef PERL_CORE
 #define Slab_Alloc             S_Slab_Alloc
+#endif
+#ifdef PERL_CORE
 #define Slab_Free              S_Slab_Free
+#endif
 #  endif
 #endif
 #if defined(PERL_IN_PERL_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define find_beginning         S_find_beginning
+#endif
+#ifdef PERL_CORE
 #define forbid_setid           S_forbid_setid
+#endif
+#ifdef PERL_CORE
 #define incpush                        S_incpush
+#endif
+#ifdef PERL_CORE
 #define init_interp            S_init_interp
+#endif
+#ifdef PERL_CORE
 #define init_ids               S_init_ids
+#endif
+#ifdef PERL_CORE
 #define init_lexer             S_init_lexer
+#endif
+#ifdef PERL_CORE
 #define init_main_stash                S_init_main_stash
+#endif
+#ifdef PERL_CORE
 #define init_perllib           S_init_perllib
+#endif
+#ifdef PERL_CORE
 #define init_postdump_symbols  S_init_postdump_symbols
+#endif
+#ifdef PERL_CORE
 #define init_predump_symbols   S_init_predump_symbols
+#endif
+#ifdef PERL_CORE
 #define my_exit_jump           S_my_exit_jump
+#endif
+#ifdef PERL_CORE
 #define nuke_stacks            S_nuke_stacks
+#endif
+#ifdef PERL_CORE
 #define open_script            S_open_script
+#endif
+#ifdef PERL_CORE
 #define usage                  S_usage
+#endif
+#ifdef PERL_CORE
 #define validate_suid          S_validate_suid
+#endif
 #  if defined(IAMSUID)
+#ifdef PERL_CORE
 #define fd_on_nosuid_fs                S_fd_on_nosuid_fs
+#endif
 #  endif
+#ifdef PERL_CORE
 #define parse_body             S_parse_body
+#endif
+#ifdef PERL_CORE
 #define run_body               S_run_body
+#endif
+#ifdef PERL_CORE
 #define call_body              S_call_body
+#endif
+#ifdef PERL_CORE
 #define call_list_body         S_call_list_body
+#endif
 #if defined(PERL_FLEXIBLE_EXCEPTIONS)
+#ifdef PERL_CORE
 #define vparse_body            S_vparse_body
+#endif
+#ifdef PERL_CORE
 #define vrun_body              S_vrun_body
+#endif
+#ifdef PERL_CORE
 #define vcall_body             S_vcall_body
+#endif
+#ifdef PERL_CORE
 #define vcall_list_body                S_vcall_list_body
 #endif
 #endif
+#endif
 #if defined(PERL_IN_PP_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define refto                  S_refto
+#endif
+#ifdef PERL_CORE
 #define seed                   S_seed
 #endif
+#endif
 #if defined(PERL_IN_PP_PACK_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define doencodes              S_doencodes
+#endif
+#ifdef PERL_CORE
 #define mul128                 S_mul128
+#endif
+#ifdef PERL_CORE
 #define is_an_int              S_is_an_int
+#endif
+#ifdef PERL_CORE
 #define div128                 S_div128
+#endif
+#ifdef PERL_CORE
 #define next_symbol            S_next_symbol
+#endif
+#ifdef PERL_CORE
 #define find_count             S_find_count
+#endif
+#ifdef PERL_CORE
 #define group_end              S_group_end
+#endif
+#ifdef PERL_CORE
 #define measure_struct         S_measure_struct
 #endif
+#endif
 #if defined(PERL_IN_PP_CTL_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define docatch                        S_docatch
+#endif
+#ifdef PERL_CORE
 #define docatch_body           S_docatch_body
+#endif
 #if defined(PERL_FLEXIBLE_EXCEPTIONS)
+#ifdef PERL_CORE
 #define vdocatch_body          S_vdocatch_body
 #endif
+#endif
+#ifdef PERL_CORE
 #define dofindlabel            S_dofindlabel
+#endif
+#ifdef PERL_CORE
 #define doparseform            S_doparseform
+#endif
+#ifdef PERL_CORE
 #define dopoptoeval            S_dopoptoeval
+#endif
+#ifdef PERL_CORE
 #define dopoptolabel           S_dopoptolabel
+#endif
+#ifdef PERL_CORE
 #define dopoptoloop            S_dopoptoloop
+#endif
+#ifdef PERL_CORE
 #define dopoptosub             S_dopoptosub
+#endif
+#ifdef PERL_CORE
 #define dopoptosub_at          S_dopoptosub_at
+#endif
+#ifdef PERL_CORE
 #define save_lines             S_save_lines
+#endif
+#ifdef PERL_CORE
 #define doeval                 S_doeval
+#endif
+#ifdef PERL_CORE
 #define doopen_pmc             S_doopen_pmc
+#endif
+#ifdef PERL_CORE
 #define path_is_absolute       S_path_is_absolute
 #endif
+#endif
 #if defined(PERL_IN_PP_HOT_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define do_oddball             S_do_oddball
+#endif
+#ifdef PERL_CORE
 #define get_db_sub             S_get_db_sub
+#endif
+#ifdef PERL_CORE
 #define method_common          S_method_common
 #endif
+#endif
 #if defined(PERL_IN_PP_SYS_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define doform                 S_doform
+#endif
+#ifdef PERL_CORE
 #define emulate_eaccess                S_emulate_eaccess
+#endif
 #  if !defined(HAS_MKDIR) || !defined(HAS_RMDIR)
+#ifdef PERL_CORE
 #define dooneliner             S_dooneliner
+#endif
 #  endif
 #endif
 #if defined(PERL_IN_REGCOMP_C) || defined(PERL_DECL_PROT)
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reg                    S_reg
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reganode               S_reganode
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regatom                        S_regatom
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regbranch              S_regbranch
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reguni                 S_reguni
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regclass               S_regclass
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regcurly               S_regcurly
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reg_node               S_reg_node
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regpiece               S_regpiece
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reginsert              S_reginsert
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regoptail              S_regoptail
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regtail                        S_regtail
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regwhite               S_regwhite
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define nextchar               S_nextchar
+#endif
 #  ifdef DEBUGGING
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define dumpuntil              S_dumpuntil
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define put_byte               S_put_byte
+#endif
 #  endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define scan_commit            S_scan_commit
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cl_anything            S_cl_anything
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cl_is_anything         S_cl_is_anything
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cl_init                        S_cl_init
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cl_init_zero           S_cl_init_zero
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cl_and                 S_cl_and
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cl_or                  S_cl_or
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define study_chunk            S_study_chunk
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define add_data               S_add_data
+#endif
+#ifdef PERL_CORE
 #define re_croak2              S_re_croak2
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regpposixcc            S_regpposixcc
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define checkposixcc           S_checkposixcc
 #endif
+#endif
 #if defined(PERL_IN_REGEXEC_C) || defined(PERL_DECL_PROT)
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regmatch               S_regmatch
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regrepeat              S_regrepeat
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regrepeat_hard         S_regrepeat_hard
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regtry                 S_regtry
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reginclass             S_reginclass
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regcppush              S_regcppush
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regcppop               S_regcppop
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regcp_set_to           S_regcp_set_to
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cache_re               S_cache_re
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reghop                 S_reghop
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reghop3                        S_reghop3
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reghopmaybe            S_reghopmaybe
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reghopmaybe3           S_reghopmaybe3
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define find_byclass           S_find_byclass
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define to_utf8_substr         S_to_utf8_substr
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define to_byte_substr         S_to_byte_substr
 #endif
+#endif
 #if defined(PERL_IN_DUMP_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define deb_curcv              S_deb_curcv
+#endif
+#ifdef PERL_CORE
 #define debprof                        S_debprof
 #endif
+#endif
 #if defined(PERL_IN_SCOPE_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define save_scalar_at         S_save_scalar_at
 #endif
+#endif
 #if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define asIV                   S_asIV
+#endif
+#ifdef PERL_CORE
 #define asUV                   S_asUV
+#endif
+#ifdef PERL_CORE
 #define more_sv                        S_more_sv
+#endif
+#ifdef PERL_CORE
 #define more_xiv               S_more_xiv
+#endif
+#ifdef PERL_CORE
 #define more_xnv               S_more_xnv
+#endif
+#ifdef PERL_CORE
 #define more_xpv               S_more_xpv
+#endif
+#ifdef PERL_CORE
 #define more_xpviv             S_more_xpviv
+#endif
+#ifdef PERL_CORE
 #define more_xpvnv             S_more_xpvnv
+#endif
+#ifdef PERL_CORE
 #define more_xpvcv             S_more_xpvcv
+#endif
+#ifdef PERL_CORE
 #define more_xpvav             S_more_xpvav
+#endif
+#ifdef PERL_CORE
 #define more_xpvhv             S_more_xpvhv
+#endif
+#ifdef PERL_CORE
 #define more_xpvmg             S_more_xpvmg
+#endif
+#ifdef PERL_CORE
 #define more_xpvlv             S_more_xpvlv
+#endif
+#ifdef PERL_CORE
 #define more_xpvbm             S_more_xpvbm
+#endif
+#ifdef PERL_CORE
 #define more_xrv               S_more_xrv
+#endif
+#ifdef PERL_CORE
 #define new_xiv                        S_new_xiv
+#endif
+#ifdef PERL_CORE
 #define new_xnv                        S_new_xnv
+#endif
+#ifdef PERL_CORE
 #define new_xpv                        S_new_xpv
+#endif
+#ifdef PERL_CORE
 #define new_xpviv              S_new_xpviv
+#endif
+#ifdef PERL_CORE
 #define new_xpvnv              S_new_xpvnv
+#endif
+#ifdef PERL_CORE
 #define new_xpvcv              S_new_xpvcv
+#endif
+#ifdef PERL_CORE
 #define new_xpvav              S_new_xpvav
+#endif
+#ifdef PERL_CORE
 #define new_xpvhv              S_new_xpvhv
+#endif
+#ifdef PERL_CORE
 #define new_xpvmg              S_new_xpvmg
+#endif
+#ifdef PERL_CORE
 #define new_xpvlv              S_new_xpvlv
+#endif
+#ifdef PERL_CORE
 #define new_xpvbm              S_new_xpvbm
+#endif
+#ifdef PERL_CORE
 #define new_xrv                        S_new_xrv
+#endif
+#ifdef PERL_CORE
 #define del_xiv                        S_del_xiv
+#endif
+#ifdef PERL_CORE
 #define del_xnv                        S_del_xnv
+#endif
+#ifdef PERL_CORE
 #define del_xpv                        S_del_xpv
+#endif
+#ifdef PERL_CORE
 #define del_xpviv              S_del_xpviv
+#endif
+#ifdef PERL_CORE
 #define del_xpvnv              S_del_xpvnv
+#endif
+#ifdef PERL_CORE
 #define del_xpvcv              S_del_xpvcv
+#endif
+#ifdef PERL_CORE
 #define del_xpvav              S_del_xpvav
+#endif
+#ifdef PERL_CORE
 #define del_xpvhv              S_del_xpvhv
+#endif
+#ifdef PERL_CORE
 #define del_xpvmg              S_del_xpvmg
+#endif
+#ifdef PERL_CORE
 #define del_xpvlv              S_del_xpvlv
+#endif
+#ifdef PERL_CORE
 #define del_xpvbm              S_del_xpvbm
+#endif
+#ifdef PERL_CORE
 #define del_xrv                        S_del_xrv
+#endif
+#ifdef PERL_CORE
 #define sv_unglob              S_sv_unglob
+#endif
+#ifdef PERL_CORE
 #define not_a_number           S_not_a_number
+#endif
+#ifdef PERL_CORE
 #define visit                  S_visit
+#endif
+#ifdef PERL_CORE
 #define sv_add_backref         S_sv_add_backref
+#endif
+#ifdef PERL_CORE
 #define sv_del_backref         S_sv_del_backref
+#endif
 #  ifdef DEBUGGING
+#ifdef PERL_CORE
 #define del_sv                 S_del_sv
+#endif
 #  endif
 #  if !defined(NV_PRESERVES_UV)
+#ifdef PERL_CORE
 #define sv_2iuv_non_preserve   S_sv_2iuv_non_preserve
+#endif
 #  endif
+#ifdef PERL_CORE
 #define expect_number          S_expect_number
+#endif
 #  if defined(USE_ITHREADS)
+#ifdef PERL_CORE
 #define gv_share               S_gv_share
+#endif
 #  endif
+#ifdef PERL_CORE
 #define utf8_mg_pos            S_utf8_mg_pos
+#endif
+#ifdef PERL_CORE
 #define utf8_mg_pos_init       S_utf8_mg_pos_init
+#endif
 #if defined(PERL_COPY_ON_WRITE)
+#ifdef PERL_CORE
 #define sv_release_COW         S_sv_release_COW
 #endif
 #endif
+#endif
 #if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define check_uni              S_check_uni
+#endif
+#ifdef PERL_CORE
 #define force_next             S_force_next
+#endif
+#ifdef PERL_CORE
 #define force_version          S_force_version
+#endif
+#ifdef PERL_CORE
 #define force_word             S_force_word
+#endif
+#ifdef PERL_CORE
 #define tokeq                  S_tokeq
+#endif
+#ifdef PERL_CORE
 #define pending_ident          S_pending_ident
+#endif
+#ifdef PERL_CORE
 #define scan_const             S_scan_const
+#endif
+#ifdef PERL_CORE
 #define scan_formline          S_scan_formline
+#endif
+#ifdef PERL_CORE
 #define scan_heredoc           S_scan_heredoc
+#endif
+#ifdef PERL_CORE
 #define scan_ident             S_scan_ident
+#endif
+#ifdef PERL_CORE
 #define scan_inputsymbol       S_scan_inputsymbol
+#endif
+#ifdef PERL_CORE
 #define scan_pat               S_scan_pat
+#endif
+#ifdef PERL_CORE
 #define scan_str               S_scan_str
+#endif
+#ifdef PERL_CORE
 #define scan_subst             S_scan_subst
+#endif
+#ifdef PERL_CORE
 #define scan_trans             S_scan_trans
+#endif
+#ifdef PERL_CORE
 #define scan_word              S_scan_word
+#endif
+#ifdef PERL_CORE
 #define skipspace              S_skipspace
+#endif
+#ifdef PERL_CORE
 #define swallow_bom            S_swallow_bom
+#endif
+#ifdef PERL_CORE
 #define checkcomma             S_checkcomma
+#endif
+#ifdef PERL_CORE
 #define force_ident            S_force_ident
+#endif
+#ifdef PERL_CORE
 #define incline                        S_incline
+#endif
+#ifdef PERL_CORE
 #define intuit_method          S_intuit_method
+#endif
+#ifdef PERL_CORE
 #define intuit_more            S_intuit_more
+#endif
+#ifdef PERL_CORE
 #define lop                    S_lop
+#endif
+#ifdef PERL_CORE
 #define missingterm            S_missingterm
+#endif
+#ifdef PERL_CORE
 #define no_op                  S_no_op
+#endif
+#ifdef PERL_CORE
 #define set_csh                        S_set_csh
+#endif
+#ifdef PERL_CORE
 #define sublex_done            S_sublex_done
+#endif
+#ifdef PERL_CORE
 #define sublex_push            S_sublex_push
+#endif
+#ifdef PERL_CORE
 #define sublex_start           S_sublex_start
+#endif
+#ifdef PERL_CORE
 #define filter_gets            S_filter_gets
+#endif
+#ifdef PERL_CORE
 #define find_in_my_stash       S_find_in_my_stash
+#endif
+#ifdef PERL_CORE
 #define new_constant           S_new_constant
+#endif
 #  if defined(DEBUGGING)
+#ifdef PERL_CORE
 #define tokereport             S_tokereport
+#endif
 #  endif
+#ifdef PERL_CORE
 #define ao                     S_ao
+#endif
+#ifdef PERL_CORE
 #define depcom                 S_depcom
+#endif
+#ifdef PERL_CORE
 #define incl_perldb            S_incl_perldb
+#endif
 #if 0
+#ifdef PERL_CORE
 #define utf16_textfilter       S_utf16_textfilter
+#endif
+#ifdef PERL_CORE
 #define utf16rev_textfilter    S_utf16rev_textfilter
 #endif
+#endif
 #  if defined(PERL_CR_FILTER)
+#ifdef PERL_CORE
 #define cr_textfilter          S_cr_textfilter
+#endif
 #  endif
 #endif
 #if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define isa_lookup             S_isa_lookup
 #endif
+#endif
 #if defined(PERL_IN_LOCALE_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define stdize_locale          S_stdize_locale
 #endif
+#endif
 #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define closest_cop            S_closest_cop
+#endif
+#ifdef PERL_CORE
 #define mess_alloc             S_mess_alloc
 #endif
+#endif
 #define sv_setsv_flags         Perl_sv_setsv_flags
 #define sv_catpvn_flags                Perl_sv_catpvn_flags
 #define sv_catsv_flags         Perl_sv_catsv_flags
 #define PerlIO_stdout          Perl_PerlIO_stdout
 #define PerlIO_stderr          Perl_PerlIO_stderr
 #endif /* PERLIO_LAYERS */
+#ifdef PERL_CORE
 #define deb_stack_all          Perl_deb_stack_all
+#endif
 #ifdef PERL_IN_DEB_C
+#ifdef PERL_CORE
 #define deb_stack_n            S_deb_stack_n
 #endif
+#endif
+#ifdef PERL_CORE
 #define pad_new                        Perl_pad_new
+#endif
+#ifdef PERL_CORE
 #define pad_undef              Perl_pad_undef
+#endif
+#ifdef PERL_CORE
 #define pad_add_name           Perl_pad_add_name
+#endif
+#ifdef PERL_CORE
 #define pad_add_anon           Perl_pad_add_anon
+#endif
+#ifdef PERL_CORE
 #define pad_check_dup          Perl_pad_check_dup
+#endif
 #ifdef DEBUGGING
+#ifdef PERL_CORE
 #define pad_setsv              Perl_pad_setsv
 #endif
+#endif
+#ifdef PERL_CORE
 #define pad_block_start                Perl_pad_block_start
+#endif
+#ifdef PERL_CORE
 #define pad_tidy               Perl_pad_tidy
+#endif
+#ifdef PERL_CORE
 #define do_dump_pad            Perl_do_dump_pad
+#endif
+#ifdef PERL_CORE
 #define pad_fixup_inner_anons  Perl_pad_fixup_inner_anons
+#endif
+#ifdef PERL_CORE
 #define pad_push               Perl_pad_push
+#endif
 #if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define pad_findlex            S_pad_findlex
+#endif
 #  if defined(DEBUGGING)
+#ifdef PERL_CORE
 #define cv_dump                        S_cv_dump
+#endif
 #  endif
+#ifdef PERL_CORE
 #define cv_clone2              S_cv_clone2
 #endif
+#endif
+#ifdef PERL_CORE
 #define find_runcv             Perl_find_runcv
+#endif
 #define ck_anoncode            Perl_ck_anoncode
 #define ck_bitop               Perl_ck_bitop
 #define ck_concat              Perl_ck_concat
 #  endif
 #endif
 #if defined(MYMALLOC)
+#ifdef PERL_CORE
 #define malloced_size          Perl_malloced_size
 #endif
+#endif
 #define get_context            Perl_get_context
 #define set_context            Perl_set_context
 #define amagic_call(a,b,c,d)   Perl_amagic_call(aTHX_ a,b,c,d)
 #define Gv_AMupdate(a)         Perl_Gv_AMupdate(aTHX_ a)
 #define gv_handler(a,b)                Perl_gv_handler(aTHX_ a,b)
+#ifdef PERL_CORE
 #define append_elem(a,b,c)     Perl_append_elem(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define append_list(a,b,c)     Perl_append_list(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define apply(a,b,c)           Perl_apply(aTHX_ a,b,c)
+#endif
 #define apply_attrs_string(a,b,c,d)    Perl_apply_attrs_string(aTHX_ a,b,c,d)
 #define av_clear(a)            Perl_av_clear(aTHX_ a)
 #define av_delete(a,b,c)       Perl_av_delete(aTHX_ a,b,c)
 #define av_exists(a,b)         Perl_av_exists(aTHX_ a,b)
 #define av_extend(a,b)         Perl_av_extend(aTHX_ a,b)
+#ifdef PERL_CORE
 #define av_fake(a,b)           Perl_av_fake(aTHX_ a,b)
+#endif
 #define av_fetch(a,b,c)                Perl_av_fetch(aTHX_ a,b,c)
 #define av_fill(a,b)           Perl_av_fill(aTHX_ a,b)
 #define av_len(a)              Perl_av_len(aTHX_ a)
 #define av_make(a,b)           Perl_av_make(aTHX_ a,b)
 #define av_pop(a)              Perl_av_pop(aTHX_ a)
 #define av_push(a,b)           Perl_av_push(aTHX_ a,b)
+#ifdef PERL_CORE
 #define av_reify(a)            Perl_av_reify(aTHX_ a)
+#endif
 #define av_shift(a)            Perl_av_shift(aTHX_ a)
 #define av_store(a,b,c)                Perl_av_store(aTHX_ a,b,c)
 #define av_undef(a)            Perl_av_undef(aTHX_ a)
 #define av_unshift(a,b)                Perl_av_unshift(aTHX_ a,b)
+#ifdef PERL_CORE
 #define bind_match(a,b,c)      Perl_bind_match(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define block_end(a,b)         Perl_block_end(aTHX_ a,b)
+#endif
 #define block_gimme()          Perl_block_gimme(aTHX)
+#ifdef PERL_CORE
 #define block_start(a)         Perl_block_start(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define boot_core_UNIVERSAL()  Perl_boot_core_UNIVERSAL(aTHX)
+#endif
+#ifdef PERL_CORE
 #define boot_core_PerlIO()     Perl_boot_core_PerlIO(aTHX)
+#endif
 #define call_list(a,b)         Perl_call_list(aTHX_ a,b)
+#ifdef PERL_CORE
 #define cando(a,b,c)           Perl_cando(aTHX_ a,b,c)
+#endif
 #define cast_ulong(a)          Perl_cast_ulong(aTHX_ a)
 #define cast_i32(a)            Perl_cast_i32(aTHX_ a)
 #define cast_iv(a)             Perl_cast_iv(aTHX_ a)
 #if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP)
 #define my_chsize(a,b)         Perl_my_chsize(aTHX_ a,b)
 #endif
+#ifdef PERL_CORE
 #define convert(a,b,c)         Perl_convert(aTHX_ a,b,c)
+#endif
 #define vcroak(a,b)            Perl_vcroak(aTHX_ a,b)
 #if defined(PERL_IMPLICIT_CONTEXT)
 #endif
+#ifdef PERL_CORE
 #define cv_ckproto(a,b,c)      Perl_cv_ckproto(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define cv_clone(a)            Perl_cv_clone(aTHX_ a)
+#endif
 #define cv_const_sv(a)         Perl_cv_const_sv(aTHX_ a)
+#ifdef PERL_CORE
 #define op_const_sv(a,b)       Perl_op_const_sv(aTHX_ a,b)
+#endif
 #define cv_undef(a)            Perl_cv_undef(aTHX_ a)
 #define cx_dump(a)             Perl_cx_dump(aTHX_ a)
 #define filter_add(a,b)                Perl_filter_add(aTHX_ a,b)
 #define filter_read(a,b,c)     Perl_filter_read(aTHX_ a,b,c)
 #define get_op_descs()         Perl_get_op_descs(aTHX)
 #define get_op_names()         Perl_get_op_names(aTHX)
+#ifdef PERL_CORE
 #define get_no_modify()                Perl_get_no_modify(aTHX)
+#endif
+#ifdef PERL_CORE
 #define get_opargs()           Perl_get_opargs(aTHX)
+#endif
 #define get_ppaddr()           Perl_get_ppaddr(aTHX)
 #define cxinc()                        Perl_cxinc(aTHX)
 #define vdeb(a,b)              Perl_vdeb(aTHX_ a,b)
 #define debstack()             Perl_debstack(aTHX)
 #define debstackptrs()         Perl_debstackptrs(aTHX)
 #define delimcpy(a,b,c,d,e,f)  Perl_delimcpy(aTHX_ a,b,c,d,e,f)
+#ifdef PERL_CORE
 #define deprecate(a)           Perl_deprecate(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define deprecate_old(a)       Perl_deprecate_old(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define vdie(a,b)              Perl_vdie(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define die_where(a,b)         Perl_die_where(aTHX_ a,b)
+#endif
 #define dounwind(a)            Perl_dounwind(aTHX_ a)
+#ifdef PERL_CORE
 #define do_aexec(a,b,c)                Perl_do_aexec(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define do_aexec5(a,b,c,d,e)   Perl_do_aexec5(aTHX_ a,b,c,d,e)
+#endif
 #define do_binmode(a,b,c)      Perl_do_binmode(aTHX_ a,b,c)
+#ifdef PERL_CORE
 #define do_chop(a,b)           Perl_do_chop(aTHX_ a,b)
+#endif
 #define do_close(a,b)          Perl_do_close(aTHX_ a,b)
+#ifdef PERL_CORE
 #define do_eof(a)              Perl_do_eof(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define do_exec(a)             Perl_do_exec(aTHX_ a)
+#endif
 #if defined(WIN32)
 #define do_aspawn(a,b,c)       Perl_do_aspawn(aTHX_ a,b,c)
 #define do_spawn(a)            Perl_do_spawn(aTHX_ a)
 #define do_spawn_nowait(a)     Perl_do_spawn_nowait(aTHX_ a)
 #endif
 #if !defined(WIN32)
+#ifdef PERL_CORE
 #define do_exec3(a,b,c)                Perl_do_exec3(aTHX_ a,b,c)
 #endif
+#endif
+#ifdef PERL_CORE
 #define do_execfree()          Perl_do_execfree(aTHX)
+#endif
 #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
+#ifdef PERL_CORE
 #define do_ipcctl(a,b,c)       Perl_do_ipcctl(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define do_ipcget(a,b,c)       Perl_do_ipcget(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define do_msgrcv(a,b)         Perl_do_msgrcv(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define do_msgsnd(a,b)         Perl_do_msgsnd(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define do_semop(a,b)          Perl_do_semop(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define do_shmio(a,b,c)                Perl_do_shmio(aTHX_ a,b,c)
 #endif
+#endif
 #define do_join(a,b,c,d)       Perl_do_join(aTHX_ a,b,c,d)
+#ifdef PERL_CORE
 #define do_kv()                        Perl_do_kv(aTHX)
+#endif
 #define do_open(a,b,c,d,e,f,g) Perl_do_open(aTHX_ a,b,c,d,e,f,g)
 #define do_open9(a,b,c,d,e,f,g,h,i)    Perl_do_open9(aTHX_ a,b,c,d,e,f,g,h,i)
 #define do_openn(a,b,c,d,e,f,g,h,i)    Perl_do_openn(aTHX_ a,b,c,d,e,f,g,h,i)
+#ifdef PERL_CORE
 #define do_pipe(a,b,c)         Perl_do_pipe(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define do_print(a,b)          Perl_do_print(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define do_readline()          Perl_do_readline(aTHX)
+#endif
+#ifdef PERL_CORE
 #define do_chomp(a)            Perl_do_chomp(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define do_seek(a,b,c)         Perl_do_seek(aTHX_ a,b,c)
+#endif
 #define do_sprintf(a,b,c)      Perl_do_sprintf(aTHX_ a,b,c)
+#ifdef PERL_CORE
 #define do_sysseek(a,b,c)      Perl_do_sysseek(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define do_tell(a)             Perl_do_tell(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define do_trans(a)            Perl_do_trans(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define do_vecget(a,b,c)       Perl_do_vecget(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define do_vecset(a)           Perl_do_vecset(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define do_vop(a,b,c,d)                Perl_do_vop(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define dofile(a)              Perl_dofile(aTHX_ a)
+#endif
 #define dowantarray()          Perl_dowantarray(aTHX)
 #define dump_all()             Perl_dump_all(aTHX)
 #define dump_eval()            Perl_dump_eval(aTHX)
 #define dump_sub(a)            Perl_dump_sub(aTHX_ a)
 #define fbm_compile(a,b)       Perl_fbm_compile(aTHX_ a,b)
 #define fbm_instr(a,b,c,d)     Perl_fbm_instr(aTHX_ a,b,c,d)
+#ifdef PERL_CORE
 #define find_script(a,b,c,d)   Perl_find_script(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define force_list(a)          Perl_force_list(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define fold_constants(a)      Perl_fold_constants(aTHX_ a)
+#endif
 #define vform(a,b)             Perl_vform(aTHX_ a,b)
 #define free_tmps()            Perl_free_tmps(aTHX)
+#ifdef PERL_CORE
 #define gen_constant_list(a)   Perl_gen_constant_list(aTHX_ a)
+#endif
 #if !defined(HAS_GETENV_LEN)
+#ifdef PERL_CORE
 #define getenv_len(a,b)                Perl_getenv_len(aTHX_ a,b)
 #endif
+#endif
 #define gp_free(a)             Perl_gp_free(aTHX_ a)
 #define gp_ref(a)              Perl_gp_ref(aTHX_ a)
 #define gv_AVadd(a)            Perl_gv_AVadd(aTHX_ a)
 #define ibcmp(a,b,c)           Perl_ibcmp(aTHX_ a,b,c)
 #define ibcmp_locale(a,b,c)    Perl_ibcmp_locale(aTHX_ a,b,c)
 #define ibcmp_utf8(a,b,c,d,e,f,g,h)    Perl_ibcmp_utf8(aTHX_ a,b,c,d,e,f,g,h)
+#ifdef PERL_CORE
 #define ingroup(a,b)           Perl_ingroup(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define init_argv_symbols(a,b) Perl_init_argv_symbols(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define init_debugger()                Perl_init_debugger(aTHX)
+#endif
 #define init_stacks()          Perl_init_stacks(aTHX)
 #define init_tm(a)             Perl_init_tm(aTHX_ a)
+#ifdef PERL_CORE
 #define intro_my()             Perl_intro_my(aTHX)
+#endif
 #define instr(a,b)             Perl_instr(aTHX_ a,b)
+#ifdef PERL_CORE
 #define io_close(a,b)          Perl_io_close(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define invert(a)              Perl_invert(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define is_gv_magical(a,b,c)   Perl_is_gv_magical(aTHX_ a,b,c)
+#endif
 #define is_lvalue_sub()                Perl_is_lvalue_sub(aTHX)
 #define to_uni_upper_lc(a)     Perl_to_uni_upper_lc(aTHX_ a)
 #define to_uni_title_lc(a)     Perl_to_uni_title_lc(aTHX_ a)
 #define is_utf8_punct(a)       Perl_is_utf8_punct(aTHX_ a)
 #define is_utf8_xdigit(a)      Perl_is_utf8_xdigit(aTHX_ a)
 #define is_utf8_mark(a)                Perl_is_utf8_mark(aTHX_ a)
+#ifdef PERL_CORE
 #define jmaybe(a)              Perl_jmaybe(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define keyword(a,b)           Perl_keyword(aTHX_ a,b)
+#endif
 #define leave_scope(a)         Perl_leave_scope(aTHX_ a)
+#ifdef PERL_CORE
 #define lex_end()              Perl_lex_end(aTHX)
+#endif
+#ifdef PERL_CORE
 #define lex_start(a)           Perl_lex_start(aTHX_ a)
+#endif
 #define op_null(a)             Perl_op_null(aTHX_ a)
+#ifdef PERL_CORE
 #define op_clear(a)            Perl_op_clear(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define linklist(a)            Perl_linklist(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define list(a)                        Perl_list(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define listkids(a)            Perl_listkids(aTHX_ a)
+#endif
 #define vload_module(a,b,c,d)  Perl_vload_module(aTHX_ a,b,c,d)
+#ifdef PERL_CORE
 #define localize(a,b)          Perl_localize(aTHX_ a,b)
+#endif
 #define looks_like_number(a)   Perl_looks_like_number(aTHX_ a)
 #define grok_bin(a,b,c,d)      Perl_grok_bin(aTHX_ a,b,c,d)
 #define grok_hex(a,b,c,d)      Perl_grok_hex(aTHX_ a,b,c,d)
 #define grok_number(a,b,c)     Perl_grok_number(aTHX_ a,b,c)
 #define grok_numeric_radix(a,b)        Perl_grok_numeric_radix(aTHX_ a,b)
 #define grok_oct(a,b,c,d)      Perl_grok_oct(aTHX_ a,b,c,d)
+#ifdef PERL_CORE
 #define magic_clearenv(a,b)    Perl_magic_clearenv(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_clear_all_env(a,b)       Perl_magic_clear_all_env(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_clearpack(a,b)   Perl_magic_clearpack(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_clearsig(a,b)    Perl_magic_clearsig(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_existspack(a,b)  Perl_magic_existspack(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_freeregexp(a,b)  Perl_magic_freeregexp(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_freeovrld(a,b)   Perl_magic_freeovrld(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_get(a,b)         Perl_magic_get(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_getarylen(a,b)   Perl_magic_getarylen(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_getdefelem(a,b)  Perl_magic_getdefelem(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_getglob(a,b)     Perl_magic_getglob(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_getnkeys(a,b)    Perl_magic_getnkeys(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_getpack(a,b)     Perl_magic_getpack(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_getpos(a,b)      Perl_magic_getpos(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_getsig(a,b)      Perl_magic_getsig(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_getsubstr(a,b)   Perl_magic_getsubstr(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_gettaint(a,b)    Perl_magic_gettaint(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_getuvar(a,b)     Perl_magic_getuvar(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_getvec(a,b)      Perl_magic_getvec(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_len(a,b)         Perl_magic_len(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_nextpack(a,b,c)  Perl_magic_nextpack(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define magic_regdata_cnt(a,b) Perl_magic_regdata_cnt(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_regdatum_get(a,b)        Perl_magic_regdatum_get(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_regdatum_set(a,b)        Perl_magic_regdatum_set(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_set(a,b)         Perl_magic_set(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setamagic(a,b)   Perl_magic_setamagic(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setarylen(a,b)   Perl_magic_setarylen(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setbm(a,b)       Perl_magic_setbm(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setdbline(a,b)   Perl_magic_setdbline(aTHX_ a,b)
+#endif
 #if defined(USE_LOCALE_COLLATE)
+#ifdef PERL_CORE
 #define magic_setcollxfrm(a,b) Perl_magic_setcollxfrm(aTHX_ a,b)
 #endif
+#endif
+#ifdef PERL_CORE
 #define magic_setdefelem(a,b)  Perl_magic_setdefelem(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setenv(a,b)      Perl_magic_setenv(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setfm(a,b)       Perl_magic_setfm(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setisa(a,b)      Perl_magic_setisa(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setglob(a,b)     Perl_magic_setglob(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setmglob(a,b)    Perl_magic_setmglob(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setnkeys(a,b)    Perl_magic_setnkeys(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setpack(a,b)     Perl_magic_setpack(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setpos(a,b)      Perl_magic_setpos(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setsig(a,b)      Perl_magic_setsig(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setsubstr(a,b)   Perl_magic_setsubstr(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_settaint(a,b)    Perl_magic_settaint(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setuvar(a,b)     Perl_magic_setuvar(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setvec(a,b)      Perl_magic_setvec(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_setutf8(a,b)     Perl_magic_setutf8(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_set_all_env(a,b) Perl_magic_set_all_env(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_sizepack(a,b)    Perl_magic_sizepack(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_wipepack(a,b)    Perl_magic_wipepack(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magicname(a,b,c)       Perl_magicname(aTHX_ a,b,c)
+#endif
 #define markstack_grow()       Perl_markstack_grow(aTHX)
 #if defined(USE_LOCALE_COLLATE)
+#ifdef PERL_CORE
 #define mem_collxfrm(a,b,c)    Perl_mem_collxfrm(aTHX_ a,b,c)
 #endif
+#endif
 #define vmess(a,b)             Perl_vmess(aTHX_ a,b)
+#ifdef PERL_CORE
 #define qerror(a)              Perl_qerror(aTHX_ a)
+#endif
 #define sortsv(a,b,c)          Perl_sortsv(aTHX_ a,b,c)
 #define mg_clear(a)            Perl_mg_clear(aTHX_ a)
 #define mg_copy(a,b,c,d)       Perl_mg_copy(aTHX_ a,b,c,d)
 #define mg_set(a)              Perl_mg_set(aTHX_ a)
 #define mg_size(a)             Perl_mg_size(aTHX_ a)
 #define mini_mktime(a)         Perl_mini_mktime(aTHX_ a)
+#ifdef PERL_CORE
 #define mod(a,b)               Perl_mod(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define mode_from_discipline(a)        Perl_mode_from_discipline(aTHX_ a)
+#endif
 #define moreswitches(a)                Perl_moreswitches(aTHX_ a)
+#ifdef PERL_CORE
 #define my(a)                  Perl_my(aTHX_ a)
+#endif
 #define my_atof(a)             Perl_my_atof(aTHX_ a)
 #if (!defined(HAS_MEMCPY) && !defined(HAS_BCOPY)) || (!defined(HAS_MEMMOVE) && !defined(HAS_SAFE_MEMCPY) && !defined(HAS_SAFE_BCOPY))
 #define my_bcopy               Perl_my_bcopy
 #define my_htonl(a)            Perl_my_htonl(aTHX_ a)
 #define my_ntohl(a)            Perl_my_ntohl(aTHX_ a)
 #endif
+#ifdef PERL_CORE
 #define my_unexec()            Perl_my_unexec(aTHX)
+#endif
 #define newANONLIST(a)         Perl_newANONLIST(aTHX_ a)
 #define newANONHASH(a)         Perl_newANONHASH(aTHX_ a)
 #define newANONSUB(a,b,c)      Perl_newANONSUB(aTHX_ a,b,c)
 #define vnumify(a)             Perl_vnumify(aTHX_ a)
 #define vstringify(a)          Perl_vstringify(aTHX_ a)
 #define vcmp(a,b)              Perl_vcmp(aTHX_ a,b)
+#ifdef PERL_CORE
 #define nextargv(a)            Perl_nextargv(aTHX_ a)
+#endif
 #define ninstr(a,b,c,d)                Perl_ninstr(aTHX_ a,b,c,d)
+#ifdef PERL_CORE
 #define oopsCV(a)              Perl_oopsCV(aTHX_ a)
+#endif
 #define op_free(a)             Perl_op_free(aTHX_ a)
+#ifdef PERL_CORE
 #define package(a)             Perl_package(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define pad_alloc(a,b)         Perl_pad_alloc(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define allocmy(a)             Perl_allocmy(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define pad_findmy(a)          Perl_pad_findmy(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define oopsAV(a)              Perl_oopsAV(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define oopsHV(a)              Perl_oopsHV(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define pad_leavemy()          Perl_pad_leavemy(aTHX)
+#endif
 #define pad_sv(a)              Perl_pad_sv(aTHX_ a)
+#ifdef PERL_CORE
 #define pad_free(a)            Perl_pad_free(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define pad_reset()            Perl_pad_reset(aTHX)
+#endif
+#ifdef PERL_CORE
 #define pad_swipe(a,b)         Perl_pad_swipe(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define peep(a)                        Perl_peep(aTHX_ a)
+#endif
+#ifdef PERL_CORE
+#endif
 #if defined(USE_REENTRANT_API)
 #define reentrant_size()       Perl_reentrant_size(aTHX)
 #define reentrant_init()       Perl_reentrant_init(aTHX)
 #define set_numeric_standard() Perl_set_numeric_standard(aTHX)
 #define require_pv(a)          Perl_require_pv(aTHX_ a)
 #define pack_cat(a,b,c,d,e,f,g)        Perl_pack_cat(aTHX_ a,b,c,d,e,f,g)
+#ifdef PERL_CORE
 #define pidgone(a,b)           Perl_pidgone(aTHX_ a,b)
+#endif
 #define pmflag(a,b)            Perl_pmflag(aTHX_ a,b)
+#ifdef PERL_CORE
 #define pmruntime(a,b,c)       Perl_pmruntime(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define pmtrans(a,b,c)         Perl_pmtrans(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define pop_return()           Perl_pop_return(aTHX)
+#endif
 #define pop_scope()            Perl_pop_scope(aTHX)
+#ifdef PERL_CORE
 #define prepend_elem(a,b,c)    Perl_prepend_elem(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define push_return(a)         Perl_push_return(aTHX_ a)
+#endif
 #define push_scope()           Perl_push_scope(aTHX)
+#ifdef PERL_CORE
 #define ref(a,b)               Perl_ref(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define refkids(a,b)           Perl_refkids(aTHX_ a,b)
+#endif
 #define regdump(a)             Perl_regdump(aTHX_ a)
 #define regclass_swash(a,b,c,d)        Perl_regclass_swash(aTHX_ a,b,c,d)
 #define pregexec(a,b,c,d,e,f,g)        Perl_pregexec(aTHX_ a,b,c,d,e,f,g)
 #define re_intuit_string(a)    Perl_re_intuit_string(aTHX_ a)
 #define regexec_flags(a,b,c,d,e,f,g,h) Perl_regexec_flags(aTHX_ a,b,c,d,e,f,g,h)
 #define regnext(a)             Perl_regnext(aTHX_ a)
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regprop(a,b)           Perl_regprop(aTHX_ a,b)
+#endif
 #define repeatcpy(a,b,c,d)     Perl_repeatcpy(aTHX_ a,b,c,d)
 #define rninstr(a,b,c,d)       Perl_rninstr(aTHX_ a,b,c,d)
 #define rsignal(a,b)           Perl_rsignal(aTHX_ a,b)
+#ifdef PERL_CORE
 #define rsignal_restore(a,b)   Perl_rsignal_restore(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define rsignal_save(a,b,c)    Perl_rsignal_save(aTHX_ a,b,c)
+#endif
 #define rsignal_state(a)       Perl_rsignal_state(aTHX_ a)
+#ifdef PERL_CORE
 #define rxres_free(a)          Perl_rxres_free(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define rxres_restore(a,b)     Perl_rxres_restore(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define rxres_save(a,b)                Perl_rxres_save(aTHX_ a,b)
+#endif
 #if !defined(HAS_RENAME)
+#ifdef PERL_CORE
 #define same_dirent(a,b)       Perl_same_dirent(aTHX_ a,b)
 #endif
+#endif
 #define savepv(a)              Perl_savepv(aTHX_ a)
 #define savesharedpv(a)                Perl_savesharedpv(aTHX_ a)
 #define savepvn(a,b)           Perl_savepvn(aTHX_ a,b)
 #define save_destructor(a,b)   Perl_save_destructor(aTHX_ a,b)
 #define save_destructor_x(a,b) Perl_save_destructor_x(aTHX_ a,b)
 #define save_freesv(a)         Perl_save_freesv(aTHX_ a)
+#ifdef PERL_CORE
 #define save_freeop(a)         Perl_save_freeop(aTHX_ a)
+#endif
 #define save_freepv(a)         Perl_save_freepv(aTHX_ a)
 #define save_generic_svref(a)  Perl_save_generic_svref(aTHX_ a)
 #define save_generic_pvref(a)  Perl_save_generic_pvref(aTHX_ a)
 #define save_long(a)           Perl_save_long(aTHX_ a)
 #define save_mortalizesv(a)    Perl_save_mortalizesv(aTHX_ a)
 #define save_nogv(a)           Perl_save_nogv(aTHX_ a)
+#ifdef PERL_CORE
 #define save_op()              Perl_save_op(aTHX)
+#endif
 #define save_scalar(a)         Perl_save_scalar(aTHX_ a)
 #define save_pptr(a)           Perl_save_pptr(aTHX_ a)
 #define save_vptr(a)           Perl_save_vptr(aTHX_ a)
 #define save_sptr(a)           Perl_save_sptr(aTHX_ a)
 #define save_svref(a)          Perl_save_svref(aTHX_ a)
 #define save_threadsv(a)       Perl_save_threadsv(aTHX_ a)
+#ifdef PERL_CORE
 #define sawparens(a)           Perl_sawparens(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define scalar(a)              Perl_scalar(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define scalarkids(a)          Perl_scalarkids(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define scalarseq(a)           Perl_scalarseq(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define scalarvoid(a)          Perl_scalarvoid(aTHX_ a)
+#endif
 #define scan_bin(a,b,c)                Perl_scan_bin(aTHX_ a,b,c)
 #define scan_hex(a,b,c)                Perl_scan_hex(aTHX_ a,b,c)
 #define scan_num(a,b)          Perl_scan_num(aTHX_ a,b)
 #define scan_oct(a,b,c)                Perl_scan_oct(aTHX_ a,b,c)
+#ifdef PERL_CORE
 #define scope(a)               Perl_scope(aTHX_ a)
+#endif
 #define screaminstr(a,b,c,d,e,f)       Perl_screaminstr(aTHX_ a,b,c,d,e,f)
 #if !defined(VMS)
+#ifdef PERL_CORE
 #define setenv_getix(a)                Perl_setenv_getix(aTHX_ a)
 #endif
+#endif
+#ifdef PERL_CORE
 #define setdefout(a)           Perl_setdefout(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define share_hek(a,b,c)       Perl_share_hek(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define sighandler             Perl_sighandler
+#endif
 #define stack_grow(a,b,c)      Perl_stack_grow(aTHX_ a,b,c)
 #define start_subparse(a,b)    Perl_start_subparse(aTHX_ a,b)
+#ifdef PERL_CORE
 #define sub_crush_depth(a)     Perl_sub_crush_depth(aTHX_ a)
+#endif
 #define sv_2bool(a)            Perl_sv_2bool(aTHX_ a)
 #define sv_2cv(a,b,c,d)                Perl_sv_2cv(aTHX_ a,b,c,d)
 #define sv_2io(a)              Perl_sv_2io(aTHX_ a)
 #define sv_pvutf8n(a,b)                Perl_sv_pvutf8n(aTHX_ a,b)
 #define sv_pvbyten(a,b)                Perl_sv_pvbyten(aTHX_ a,b)
 #define sv_true(a)             Perl_sv_true(aTHX_ a)
+#ifdef PERL_CORE
 #define sv_add_arena(a,b,c)    Perl_sv_add_arena(aTHX_ a,b,c)
+#endif
 #define sv_backoff(a)          Perl_sv_backoff(aTHX_ a)
 #define sv_bless(a,b)          Perl_sv_bless(aTHX_ a,b)
 #define sv_vcatpvf(a,b,c)      Perl_sv_vcatpvf(aTHX_ a,b,c)
 #define sv_catpv(a,b)          Perl_sv_catpv(aTHX_ a,b)
 #define sv_chop(a,b)           Perl_sv_chop(aTHX_ a,b)
+#ifdef PERL_CORE
 #define sv_clean_all()         Perl_sv_clean_all(aTHX)
+#endif
+#ifdef PERL_CORE
 #define sv_clean_objs()                Perl_sv_clean_objs(aTHX)
+#endif
 #define sv_clear(a)            Perl_sv_clear(aTHX_ a)
 #define sv_cmp(a,b)            Perl_sv_cmp(aTHX_ a,b)
 #define sv_cmp_locale(a,b)     Perl_sv_cmp_locale(aTHX_ a,b)
 #define sv_derived_from(a,b)   Perl_sv_derived_from(aTHX_ a,b)
 #define sv_eq(a,b)             Perl_sv_eq(aTHX_ a,b)
 #define sv_free(a)             Perl_sv_free(aTHX_ a)
+#ifdef PERL_CORE
 #define sv_free_arenas()       Perl_sv_free_arenas(aTHX)
+#endif
 #define sv_gets(a,b,c)         Perl_sv_gets(aTHX_ a,b,c)
 #define sv_grow(a,b)           Perl_sv_grow(aTHX_ a,b)
 #define sv_inc(a)              Perl_sv_inc(aTHX_ a)
 #endif
 #define unpack_str(a,b,c,d,e,f,g,h)    Perl_unpack_str(aTHX_ a,b,c,d,e,f,g,h)
 #define unsharepvn(a,b,c)      Perl_unsharepvn(aTHX_ a,b,c)
+#ifdef PERL_CORE
 #define unshare_hek(a)         Perl_unshare_hek(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define utilize(a,b,c,d,e)     Perl_utilize(aTHX_ a,b,c,d,e)
+#endif
 #define utf16_to_utf8(a,b,c,d) Perl_utf16_to_utf8(aTHX_ a,b,c,d)
 #define utf16_to_utf8_reversed(a,b,c,d)        Perl_utf16_to_utf8_reversed(aTHX_ a,b,c,d)
 #define utf8_length(a,b)       Perl_utf8_length(aTHX_ a,b)
 #define uvuni_to_utf8_flags(a,b,c)     Perl_uvuni_to_utf8_flags(aTHX_ a,b,c)
 #define pv_uni_display(a,b,c,d,e)      Perl_pv_uni_display(aTHX_ a,b,c,d,e)
 #define sv_uni_display(a,b,c,d)        Perl_sv_uni_display(aTHX_ a,b,c,d)
+#ifdef PERL_CORE
 #define vivify_defelem(a)      Perl_vivify_defelem(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define vivify_ref(a,b)                Perl_vivify_ref(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define wait4pid(a,b,c)                Perl_wait4pid(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define report_evil_fh(a,b,c)  Perl_report_evil_fh(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define report_uninit()                Perl_report_uninit(aTHX)
+#endif
 #define vwarn(a,b)             Perl_vwarn(aTHX_ a,b)
 #define vwarner(a,b,c)         Perl_vwarner(aTHX_ a,b,c)
+#ifdef PERL_CORE
 #define watch(a)               Perl_watch(aTHX_ a)
+#endif
 #define whichsig(a)            Perl_whichsig(aTHX_ a)
+#ifdef PERL_CORE
 #define yyerror(a)             Perl_yyerror(aTHX_ a)
+#endif
 #ifdef USE_PURE_BISON
+#ifdef PERL_CORE
 #define yylex_r(a,b)           Perl_yylex_r(aTHX_ a,b)
 #endif
+#endif
+#ifdef PERL_CORE
 #define yylex()                        Perl_yylex(aTHX)
+#endif
+#ifdef PERL_CORE
 #define yyparse()              Perl_yyparse(aTHX)
+#endif
+#ifdef PERL_CORE
 #define yywarn(a)              Perl_yywarn(aTHX_ a)
+#endif
 #if defined(MYMALLOC)
 #define dump_mstats(a)         Perl_dump_mstats(aTHX_ a)
 #define get_mstats(a,b,c)      Perl_get_mstats(aTHX_ a,b,c)
 #define sv_force_normal_flags(a,b)     Perl_sv_force_normal_flags(aTHX_ a,b)
 #define tmps_grow(a)           Perl_tmps_grow(aTHX_ a)
 #define sv_rvweaken(a)         Perl_sv_rvweaken(aTHX_ a)
+#ifdef PERL_CORE
 #define magic_killbackrefs(a,b)        Perl_magic_killbackrefs(aTHX_ a,b)
+#endif
 #define newANONATTRSUB(a,b,c,d)        Perl_newANONATTRSUB(aTHX_ a,b,c,d)
 #define newATTRSUB(a,b,c,d,e)  Perl_newATTRSUB(aTHX_ a,b,c,d,e)
 #define newMYSUB(a,b,c,d,e)    Perl_newMYSUB(aTHX_ a,b,c,d,e)
+#ifdef PERL_CORE
 #define my_attrs(a,b)          Perl_my_attrs(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define boot_core_xsutils()    Perl_boot_core_xsutils(aTHX)
+#endif
 #if defined(USE_ITHREADS)
 #define cx_dup(a,b,c,d)                Perl_cx_dup(aTHX_ a,b,c,d)
 #define si_dup(a,b)            Perl_si_dup(aTHX_ a,b)
 #define custom_op_name(a)      Perl_custom_op_name(aTHX_ a)
 #define custom_op_desc(a)      Perl_custom_op_desc(aTHX_ a)
 #if defined(PERL_COPY_ON_WRITE)
+#ifdef PERL_CORE
 #define sv_release_IVX(a)      Perl_sv_release_IVX(aTHX_ a)
 #endif
+#endif
 #define sv_nosharing(a)                Perl_sv_nosharing(aTHX_ a)
 #define sv_nolocking(a)                Perl_sv_nolocking(aTHX_ a)
 #define sv_nounlocking(a)      Perl_sv_nounlocking(aTHX_ a)
 #define nothreadhook()         Perl_nothreadhook(aTHX)
 #if defined(PERL_IN_DOOP_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define do_trans_simple(a)     S_do_trans_simple(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define do_trans_count(a)      S_do_trans_count(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define do_trans_complex(a)    S_do_trans_complex(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define do_trans_simple_utf8(a)        S_do_trans_simple_utf8(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define do_trans_count_utf8(a) S_do_trans_count_utf8(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define do_trans_complex_utf8(a)       S_do_trans_complex_utf8(aTHX_ a)
 #endif
+#endif
 #if defined(PERL_IN_GV_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define gv_init_sv(a,b)                S_gv_init_sv(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define require_errno(a)       S_require_errno(aTHX_ a)
 #endif
+#endif
 #if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define hsplit(a)              S_hsplit(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define hfreeentries(a)                S_hfreeentries(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define more_he()              S_more_he(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_he()               S_new_he(aTHX)
+#endif
+#ifdef PERL_CORE
 #define del_he(a)              S_del_he(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define save_hek_flags(a,b,c,d)        S_save_hek_flags(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define hv_magic_check(a,b,c)  S_hv_magic_check(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define unshare_hek_or_pvn(a,b,c,d)    S_unshare_hek_or_pvn(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define share_hek_flags(a,b,c,d)       S_share_hek_flags(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define hv_fetch_flags(a,b,c,d,e)      S_hv_fetch_flags(aTHX_ a,b,c,d,e)
+#endif
+#ifdef PERL_CORE
 #define hv_notallowed(a,b,c,d) S_hv_notallowed(aTHX_ a,b,c,d)
 #endif
+#endif
 #if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define save_magic(a,b)                S_save_magic(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define magic_methpack(a,b,c)  S_magic_methpack(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define magic_methcall(a,b,c,d,e,f)    S_magic_methcall(aTHX_ a,b,c,d,e,f)
 #endif
+#endif
 #if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define list_assignment(a)     S_list_assignment(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define bad_type(a,b,c,d)      S_bad_type(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define cop_free(a)            S_cop_free(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define modkids(a,b)           S_modkids(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define no_bareword_allowed(a) S_no_bareword_allowed(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define no_fh_allowed(a)       S_no_fh_allowed(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define scalarboolean(a)       S_scalarboolean(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define too_few_arguments(a,b) S_too_few_arguments(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define too_many_arguments(a,b)        S_too_many_arguments(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define newDEFSVOP()           S_newDEFSVOP(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_logop(a,b,c,d)     S_new_logop(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define simplify_sort(a)       S_simplify_sort(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define is_handle_constructor(a,b)     S_is_handle_constructor(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define gv_ename(a)            S_gv_ename(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define scalar_mod_type(a,b)   S_scalar_mod_type(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define my_kid(a,b,c)          S_my_kid(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define dup_attrlist(a)                S_dup_attrlist(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define apply_attrs(a,b,c,d)   S_apply_attrs(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define apply_attrs_my(a,b,c,d)        S_apply_attrs_my(aTHX_ a,b,c,d)
+#endif
 #  if defined(PL_OP_SLAB_ALLOC)
+#ifdef PERL_CORE
 #define Slab_Alloc(a,b)                S_Slab_Alloc(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define Slab_Free(a)           S_Slab_Free(aTHX_ a)
+#endif
 #  endif
 #endif
 #if defined(PERL_IN_PERL_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define find_beginning()       S_find_beginning(aTHX)
+#endif
+#ifdef PERL_CORE
 #define forbid_setid(a)                S_forbid_setid(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define incpush(a,b,c,d)       S_incpush(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define init_interp()          S_init_interp(aTHX)
+#endif
+#ifdef PERL_CORE
 #define init_ids()             S_init_ids(aTHX)
+#endif
+#ifdef PERL_CORE
 #define init_lexer()           S_init_lexer(aTHX)
+#endif
+#ifdef PERL_CORE
 #define init_main_stash()      S_init_main_stash(aTHX)
+#endif
+#ifdef PERL_CORE
 #define init_perllib()         S_init_perllib(aTHX)
+#endif
+#ifdef PERL_CORE
 #define init_postdump_symbols(a,b,c)   S_init_postdump_symbols(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define init_predump_symbols() S_init_predump_symbols(aTHX)
+#endif
+#ifdef PERL_CORE
 #define my_exit_jump()         S_my_exit_jump(aTHX)
+#endif
+#ifdef PERL_CORE
 #define nuke_stacks()          S_nuke_stacks(aTHX)
+#endif
+#ifdef PERL_CORE
 #define open_script(a,b,c,d)   S_open_script(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define usage(a)               S_usage(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define validate_suid(a,b,c)   S_validate_suid(aTHX_ a,b,c)
+#endif
 #  if defined(IAMSUID)
+#ifdef PERL_CORE
 #define fd_on_nosuid_fs(a)     S_fd_on_nosuid_fs(aTHX_ a)
+#endif
 #  endif
+#ifdef PERL_CORE
 #define parse_body(a,b)                S_parse_body(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define run_body(a)            S_run_body(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define call_body(a,b)         S_call_body(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define call_list_body(a)      S_call_list_body(aTHX_ a)
+#endif
 #if defined(PERL_FLEXIBLE_EXCEPTIONS)
+#ifdef PERL_CORE
 #define vparse_body(a)         S_vparse_body(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define vrun_body(a)           S_vrun_body(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define vcall_body(a)          S_vcall_body(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define vcall_list_body(a)     S_vcall_list_body(aTHX_ a)
 #endif
 #endif
+#endif
 #if defined(PERL_IN_PP_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define refto(a)               S_refto(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define seed()                 S_seed(aTHX)
 #endif
+#endif
 #if defined(PERL_IN_PP_PACK_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define doencodes(a,b,c)       S_doencodes(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define mul128(a,b)            S_mul128(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define is_an_int(a,b)         S_is_an_int(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define div128(a,b)            S_div128(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define next_symbol(a,b)       S_next_symbol(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define find_count(a,b,c)      S_find_count(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define group_end(a,b,c)       S_group_end(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define measure_struct(a,b)    S_measure_struct(aTHX_ a,b)
 #endif
+#endif
 #if defined(PERL_IN_PP_CTL_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define docatch(a)             S_docatch(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define docatch_body()         S_docatch_body(aTHX)
+#endif
 #if defined(PERL_FLEXIBLE_EXCEPTIONS)
+#ifdef PERL_CORE
 #define vdocatch_body(a)       S_vdocatch_body(aTHX_ a)
 #endif
+#endif
+#ifdef PERL_CORE
 #define dofindlabel(a,b,c,d)   S_dofindlabel(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define doparseform(a)         S_doparseform(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define dopoptoeval(a)         S_dopoptoeval(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define dopoptolabel(a)                S_dopoptolabel(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define dopoptoloop(a)         S_dopoptoloop(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define dopoptosub(a)          S_dopoptosub(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define dopoptosub_at(a,b)     S_dopoptosub_at(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define save_lines(a,b)                S_save_lines(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define doeval(a,b,c,d)                S_doeval(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define doopen_pmc(a,b)                S_doopen_pmc(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define path_is_absolute(a)    S_path_is_absolute(aTHX_ a)
 #endif
+#endif
 #if defined(PERL_IN_PP_HOT_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define do_oddball(a,b,c)      S_do_oddball(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define get_db_sub(a,b)                S_get_db_sub(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define method_common(a,b)     S_method_common(aTHX_ a,b)
 #endif
+#endif
 #if defined(PERL_IN_PP_SYS_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define doform(a,b,c)          S_doform(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define emulate_eaccess(a,b)   S_emulate_eaccess(aTHX_ a,b)
+#endif
 #  if !defined(HAS_MKDIR) || !defined(HAS_RMDIR)
+#ifdef PERL_CORE
 #define dooneliner(a,b)                S_dooneliner(aTHX_ a,b)
+#endif
 #  endif
 #endif
 #if defined(PERL_IN_REGCOMP_C) || defined(PERL_DECL_PROT)
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reg(a,b,c)             S_reg(aTHX_ a,b,c)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reganode(a,b,c)                S_reganode(aTHX_ a,b,c)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regatom(a,b)           S_regatom(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regbranch(a,b,c)       S_regbranch(aTHX_ a,b,c)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reguni(a,b,c,d)                S_reguni(aTHX_ a,b,c,d)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regclass(a)            S_regclass(aTHX_ a)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regcurly(a)            S_regcurly(aTHX_ a)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reg_node(a,b)          S_reg_node(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regpiece(a,b)          S_regpiece(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reginsert(a,b,c)       S_reginsert(aTHX_ a,b,c)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regoptail(a,b,c)       S_regoptail(aTHX_ a,b,c)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regtail(a,b,c)         S_regtail(aTHX_ a,b,c)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regwhite(a,b)          S_regwhite(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define nextchar(a)            S_nextchar(aTHX_ a)
+#endif
 #  ifdef DEBUGGING
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define dumpuntil(a,b,c,d,e)   S_dumpuntil(aTHX_ a,b,c,d,e)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define put_byte(a,b)          S_put_byte(aTHX_ a,b)
+#endif
 #  endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define scan_commit(a,b)       S_scan_commit(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cl_anything(a,b)       S_cl_anything(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cl_is_anything(a)      S_cl_is_anything(aTHX_ a)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cl_init(a,b)           S_cl_init(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cl_init_zero(a,b)      S_cl_init_zero(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cl_and(a,b)            S_cl_and(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cl_or(a,b,c)           S_cl_or(aTHX_ a,b,c)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define study_chunk(a,b,c,d,e,f)       S_study_chunk(aTHX_ a,b,c,d,e,f)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define add_data(a,b,c)                S_add_data(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regpposixcc(a,b)       S_regpposixcc(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define checkposixcc(a)                S_checkposixcc(aTHX_ a)
 #endif
+#endif
 #if defined(PERL_IN_REGEXEC_C) || defined(PERL_DECL_PROT)
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regmatch(a)            S_regmatch(aTHX_ a)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regrepeat(a,b)         S_regrepeat(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regrepeat_hard(a,b,c)  S_regrepeat_hard(aTHX_ a,b,c)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regtry(a,b)            S_regtry(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reginclass(a,b,c,d)    S_reginclass(aTHX_ a,b,c,d)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regcppush(a)           S_regcppush(aTHX_ a)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regcppop()             S_regcppop(aTHX)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define regcp_set_to(a)                S_regcp_set_to(aTHX_ a)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define cache_re(a)            S_cache_re(aTHX_ a)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reghop(a,b)            S_reghop(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reghop3(a,b,c)         S_reghop3(aTHX_ a,b,c)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reghopmaybe(a,b)       S_reghopmaybe(aTHX_ a,b)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define reghopmaybe3(a,b,c)    S_reghopmaybe3(aTHX_ a,b,c)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define find_byclass(a,b,c,d,e,f)      S_find_byclass(aTHX_ a,b,c,d,e,f)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define to_utf8_substr(a)      S_to_utf8_substr(aTHX_ a)
+#endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
 #define to_byte_substr(a)      S_to_byte_substr(aTHX_ a)
 #endif
+#endif
 #if defined(PERL_IN_DUMP_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define deb_curcv(a)           S_deb_curcv(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define debprof(a)             S_debprof(aTHX_ a)
 #endif
+#endif
 #if defined(PERL_IN_SCOPE_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define save_scalar_at(a)      S_save_scalar_at(aTHX_ a)
 #endif
+#endif
 #if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define asIV(a)                        S_asIV(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define asUV(a)                        S_asUV(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define more_sv()              S_more_sv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define more_xiv()             S_more_xiv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define more_xnv()             S_more_xnv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define more_xpv()             S_more_xpv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define more_xpviv()           S_more_xpviv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define more_xpvnv()           S_more_xpvnv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define more_xpvcv()           S_more_xpvcv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define more_xpvav()           S_more_xpvav(aTHX)
+#endif
+#ifdef PERL_CORE
 #define more_xpvhv()           S_more_xpvhv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define more_xpvmg()           S_more_xpvmg(aTHX)
+#endif
+#ifdef PERL_CORE
 #define more_xpvlv()           S_more_xpvlv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define more_xpvbm()           S_more_xpvbm(aTHX)
+#endif
+#ifdef PERL_CORE
 #define more_xrv()             S_more_xrv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_xiv()              S_new_xiv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_xnv()              S_new_xnv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_xpv()              S_new_xpv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_xpviv()            S_new_xpviv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_xpvnv()            S_new_xpvnv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_xpvcv()            S_new_xpvcv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_xpvav()            S_new_xpvav(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_xpvhv()            S_new_xpvhv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_xpvmg()            S_new_xpvmg(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_xpvlv()            S_new_xpvlv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_xpvbm()            S_new_xpvbm(aTHX)
+#endif
+#ifdef PERL_CORE
 #define new_xrv()              S_new_xrv(aTHX)
+#endif
+#ifdef PERL_CORE
 #define del_xiv(a)             S_del_xiv(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define del_xnv(a)             S_del_xnv(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define del_xpv(a)             S_del_xpv(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define del_xpviv(a)           S_del_xpviv(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define del_xpvnv(a)           S_del_xpvnv(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define del_xpvcv(a)           S_del_xpvcv(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define del_xpvav(a)           S_del_xpvav(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define del_xpvhv(a)           S_del_xpvhv(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define del_xpvmg(a)           S_del_xpvmg(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define del_xpvlv(a)           S_del_xpvlv(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define del_xpvbm(a)           S_del_xpvbm(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define del_xrv(a)             S_del_xrv(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define sv_unglob(a)           S_sv_unglob(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define not_a_number(a)                S_not_a_number(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define visit(a)               S_visit(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define sv_add_backref(a,b)    S_sv_add_backref(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define sv_del_backref(a)      S_sv_del_backref(aTHX_ a)
+#endif
 #  ifdef DEBUGGING
+#ifdef PERL_CORE
 #define del_sv(a)              S_del_sv(aTHX_ a)
+#endif
 #  endif
 #  if !defined(NV_PRESERVES_UV)
+#ifdef PERL_CORE
 #define sv_2iuv_non_preserve(a,b)      S_sv_2iuv_non_preserve(aTHX_ a,b)
+#endif
 #  endif
+#ifdef PERL_CORE
 #define expect_number(a)       S_expect_number(aTHX_ a)
+#endif
 #  if defined(USE_ITHREADS)
+#ifdef PERL_CORE
 #define gv_share(a,b)          S_gv_share(aTHX_ a,b)
+#endif
 #  endif
+#ifdef PERL_CORE
 #define utf8_mg_pos(a,b,c,d,e,f,g,h,i) S_utf8_mg_pos(aTHX_ a,b,c,d,e,f,g,h,i)
+#endif
+#ifdef PERL_CORE
 #define utf8_mg_pos_init(a,b,c,d,e,f,g)        S_utf8_mg_pos_init(aTHX_ a,b,c,d,e,f,g)
+#endif
 #if defined(PERL_COPY_ON_WRITE)
+#ifdef PERL_CORE
 #define sv_release_COW(a,b,c,d,e,f)    S_sv_release_COW(aTHX_ a,b,c,d,e,f)
 #endif
 #endif
+#endif
 #if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define check_uni()            S_check_uni(aTHX)
+#endif
+#ifdef PERL_CORE
 #define force_next(a)          S_force_next(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define force_version(a,b)     S_force_version(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define force_word(a,b,c,d,e)  S_force_word(aTHX_ a,b,c,d,e)
+#endif
+#ifdef PERL_CORE
 #define tokeq(a)               S_tokeq(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define pending_ident()                S_pending_ident(aTHX)
+#endif
+#ifdef PERL_CORE
 #define scan_const(a)          S_scan_const(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define scan_formline(a)       S_scan_formline(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define scan_heredoc(a)                S_scan_heredoc(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define scan_ident(a,b,c,d,e)  S_scan_ident(aTHX_ a,b,c,d,e)
+#endif
+#ifdef PERL_CORE
 #define scan_inputsymbol(a)    S_scan_inputsymbol(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define scan_pat(a,b)          S_scan_pat(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define scan_str(a,b,c)                S_scan_str(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define scan_subst(a)          S_scan_subst(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define scan_trans(a)          S_scan_trans(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define scan_word(a,b,c,d,e)   S_scan_word(aTHX_ a,b,c,d,e)
+#endif
+#ifdef PERL_CORE
 #define skipspace(a)           S_skipspace(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define swallow_bom(a)         S_swallow_bom(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define checkcomma(a,b,c)      S_checkcomma(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define force_ident(a,b)       S_force_ident(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define incline(a)             S_incline(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define intuit_method(a,b)     S_intuit_method(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define intuit_more(a)         S_intuit_more(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define lop(a,b,c)             S_lop(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define missingterm(a)         S_missingterm(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define no_op(a,b)             S_no_op(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define set_csh()              S_set_csh(aTHX)
+#endif
+#ifdef PERL_CORE
 #define sublex_done()          S_sublex_done(aTHX)
+#endif
+#ifdef PERL_CORE
 #define sublex_push()          S_sublex_push(aTHX)
+#endif
+#ifdef PERL_CORE
 #define sublex_start()         S_sublex_start(aTHX)
+#endif
+#ifdef PERL_CORE
 #define filter_gets(a,b,c)     S_filter_gets(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define find_in_my_stash(a,b)  S_find_in_my_stash(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define new_constant(a,b,c,d,e,f)      S_new_constant(aTHX_ a,b,c,d,e,f)
+#endif
 #  if defined(DEBUGGING)
+#ifdef PERL_CORE
 #define tokereport(a,b,c)      S_tokereport(aTHX_ a,b,c)
+#endif
 #  endif
+#ifdef PERL_CORE
 #define ao(a)                  S_ao(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define depcom()               S_depcom(aTHX)
+#endif
+#ifdef PERL_CORE
 #define incl_perldb()          S_incl_perldb(aTHX)
+#endif
 #if 0
+#ifdef PERL_CORE
 #define utf16_textfilter(a,b,c)        S_utf16_textfilter(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define utf16rev_textfilter(a,b,c)     S_utf16rev_textfilter(aTHX_ a,b,c)
 #endif
+#endif
 #  if defined(PERL_CR_FILTER)
+#ifdef PERL_CORE
 #define cr_textfilter(a,b,c)   S_cr_textfilter(aTHX_ a,b,c)
+#endif
 #  endif
 #endif
 #if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define isa_lookup(a,b,c,d,e)  S_isa_lookup(aTHX_ a,b,c,d,e)
 #endif
+#endif
 #if defined(PERL_IN_LOCALE_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define stdize_locale(a)       S_stdize_locale(aTHX_ a)
 #endif
+#endif
 #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define closest_cop(a,b)       S_closest_cop(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define mess_alloc()           S_mess_alloc(aTHX)
 #endif
+#endif
 #define sv_setsv_flags(a,b,c)  Perl_sv_setsv_flags(aTHX_ a,b,c)
 #define sv_catpvn_flags(a,b,c,d)       Perl_sv_catpvn_flags(aTHX_ a,b,c,d)
 #define sv_catsv_flags(a,b,c)  Perl_sv_catsv_flags(aTHX_ a,b,c)
 #define PerlIO_stdout()                Perl_PerlIO_stdout(aTHX)
 #define PerlIO_stderr()                Perl_PerlIO_stderr(aTHX)
 #endif /* PERLIO_LAYERS */
+#ifdef PERL_CORE
 #define deb_stack_all()                Perl_deb_stack_all(aTHX)
+#endif
 #ifdef PERL_IN_DEB_C
+#ifdef PERL_CORE
 #define deb_stack_n(a,b,c,d,e) S_deb_stack_n(aTHX_ a,b,c,d,e)
 #endif
+#endif
+#ifdef PERL_CORE
 #define pad_new(a)             Perl_pad_new(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define pad_undef(a)           Perl_pad_undef(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define pad_add_name(a,b,c,d)  Perl_pad_add_name(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define pad_add_anon(a,b)      Perl_pad_add_anon(aTHX_ a,b)
+#endif
+#ifdef PERL_CORE
 #define pad_check_dup(a,b,c)   Perl_pad_check_dup(aTHX_ a,b,c)
+#endif
 #ifdef DEBUGGING
+#ifdef PERL_CORE
 #define pad_setsv(a,b)         Perl_pad_setsv(aTHX_ a,b)
 #endif
+#endif
+#ifdef PERL_CORE
 #define pad_block_start(a)     Perl_pad_block_start(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define pad_tidy(a)            Perl_pad_tidy(aTHX_ a)
+#endif
+#ifdef PERL_CORE
 #define do_dump_pad(a,b,c,d)   Perl_do_dump_pad(aTHX_ a,b,c,d)
+#endif
+#ifdef PERL_CORE
 #define pad_fixup_inner_anons(a,b,c)   Perl_pad_fixup_inner_anons(aTHX_ a,b,c)
+#endif
+#ifdef PERL_CORE
 #define pad_push(a,b,c)                Perl_pad_push(aTHX_ a,b,c)
+#endif
 #if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
 #define pad_findlex(a,b,c)     S_pad_findlex(aTHX_ a,b,c)
+#endif
 #  if defined(DEBUGGING)
+#ifdef PERL_CORE
 #define cv_dump(a,b)           S_cv_dump(aTHX_ a,b)
+#endif
 #  endif
+#ifdef PERL_CORE
 #define cv_clone2(a,b)         S_cv_clone2(aTHX_ a,b)
 #endif
+#endif
+#ifdef PERL_CORE
 #define find_runcv(a)          Perl_find_runcv(aTHX_ a)
+#endif
 #define ck_anoncode(a)         Perl_ck_anoncode(aTHX_ a)
 #define ck_bitop(a)            Perl_ck_bitop(aTHX_ a)
 #define ck_concat(a)           Perl_ck_concat(aTHX_ a)
index bec3ca1..a2a509e 100755 (executable)
--- a/embed.pl
+++ b/embed.pl
@@ -340,6 +340,13 @@ walk_table {
                $ret .= hide($func,"Perl_$func");
            }
        }
+         unless ($flags =~ /A/) {
+           if ($flags =~ /E/) {
+               $ret = "#if defined(PERL_CORE) || defined(PERL_EXT)\n$ret#endif\n";
+           } else {
+               $ret = "#ifdef PERL_CORE\n$ret#endif\n";
+           }
+        }
     }
     $ret;
 } \*EM, "";
@@ -393,6 +400,13 @@ walk_table {
                $ret .= $alist . ")\n";
            }
        }
+         unless ($flags =~ /A/) {
+           if ($flags =~ /E/) {
+               $ret = "#if defined(PERL_CORE) || defined(PERL_EXT)\n$ret#endif\n";
+           } else {
+               $ret = "#ifdef PERL_CORE\n$ret#endif\n";
+           }
+        }
     }
     $ret;
 } \*EM, "";
index 51573af..f00f412 100644 (file)
@@ -4,7 +4,7 @@ use Config;
 
 my $object = 're_exec$(OBJ_EXT) re_comp$(OBJ_EXT) re$(OBJ_EXT)';
 
-my $defines = '-DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG';
+my $defines = '-DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG -DPERL_EXT';
 
 WriteMakefile(
     NAME               => 're',
index 9e3ddcd..a4ad684 100644 (file)
@@ -79,6 +79,7 @@ Perl_filter_read
 Perl_get_op_descs
 Perl_get_op_names
 Perl_get_ppaddr
+Perl_cxinc
 Perl_deb
 Perl_vdeb
 Perl_debprofdump