diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2015-05-21 17:06:27 -0400 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2015-06-03 12:07:09 +1000 |
commit | 1c68cbf70f1d1b9aaa6a927943d4f1c075ce8d1c (patch) | |
tree | acdc2fbdf06ff9ec144cec709ab13b21bcc1a96a /win32/config_h.PL | |
parent | 269713a163ea7f178a8c2a31d3c0e5caf5cbf7ce (diff) | |
download | perl-1c68cbf70f1d1b9aaa6a927943d4f1c075ce8d1c.tar.gz |
refactor win32_get_*lib() funcs to match rest of PERL_IMPLICIT_SYS API
The front end of PERL_IMPLICIT_SYS is PerlEnv_*/PerlSock_*/PerlProc_*/etc
macros. These are either macroed to C vtable calls when PERL_IMPLICIT_SYS
is on, or to the backend raw win32_*() functions when PERL_IMPLICIT_SYS
is off.
win32_get_*() were not following this convention. All this code looks like
a hack as if someone didn't have perms to edit perl.c, but they did have
perms to edit /win32, so they devise a scheme of hooking "unhooked"
win32_get_*() functions with win32.h macros for win32_get_*() to call the
Perl*() virutalization macros, and rename the original function bodies in
win32.c to g_win32_get_*() as to not make a macro loop.
Undo all of this hack by having perl.c call correct PerlEnv_* macro. This
refactoring will be useful for a future patch in #123658 to disable
win32 registry lookups.
Diffstat (limited to 'win32/config_h.PL')
-rw-r--r-- | win32/config_h.PL | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/win32/config_h.PL b/win32/config_h.PL index 03dddb3b8a..1280655422 100644 --- a/win32/config_h.PL +++ b/win32/config_h.PL @@ -63,7 +63,12 @@ while (<SH>) s#(.)/\*\*/#$1/ **/# if(/^\/\*/); #avoid "/*" inside comments if (/^\s*#define\s+(PRIVLIB|SITELIB|VENDORLIB)_EXP/) { - $_ = "#define ". $1 . "_EXP (win32_get_". lc($1) . "(PERL_VERSION_STRING, NULL))\t/**/\n"; + $_ = '#define '. $1 . '_EXP ('.( + $1 eq 'PRIVLIB' ? 'PerlEnv_lib_path' : + $1 eq 'SITELIB' ? 'PerlEnv_sitelib_path' : + $1 eq 'VENDORLIB' ? 'PerlEnv_vendorlib_path' : + die "unknown *LIB_EXP define \"$1\"" + ). "(PERL_VERSION_STRING, NULL))\t/**/\n"; } # incpush() handles archlibs, so disable them elsif (/^\s*#define\s+(ARCHLIB|SITEARCH|VENDORARCH)_EXP/) |