diff options
author | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2020-03-20 21:15:43 +0000 |
---|---|---|
committer | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2020-07-20 23:28:12 +0100 |
commit | 8c3a0f6ca6a8f3a02c3394507eb4284c1017dba1 (patch) | |
tree | aaa777b26aeec48b155ff5b6465bdf8be109d7d4 /regen/embed.pl | |
parent | 822c8b4dc3fe62cd97d78e693e5871fcc65782fd (diff) | |
download | perl-8c3a0f6ca6a8f3a02c3394507eb4284c1017dba1.tar.gz |
Remove PERL_GLOBAL_STRUCT
This was originally added for MinGW, which no longer needs it, and
only still used by Symbian, which is now removed.
This also leaves perlapi.[ch] empty, but we keep the header for CPAN
backwards compatibility.
Diffstat (limited to 'regen/embed.pl')
-rwxr-xr-x | regen/embed.pl | 171 |
1 files changed, 0 insertions, 171 deletions
diff --git a/regen/embed.pl b/regen/embed.pl index 5c33127e86..cdd9f5709c 100755 --- a/regen/embed.pl +++ b/regen/embed.pl @@ -4,8 +4,6 @@ # # embed.h # embedvar.h -# perlapi.c -# perlapi.h # proto.h # # from information stored in @@ -526,179 +524,10 @@ for $sym (@intrp) { print $em <<'END'; #endif /* MULTIPLICITY */ - -#if defined(PERL_GLOBAL_STRUCT) - -END - -for $sym (@globvar) { - print $em "#ifdef OS2\n" if $sym eq 'sh_path'; - print $em "#ifdef __VMS\n" if $sym eq 'perllib_sep'; - print $em multon($sym, 'G','my_vars->'); - print $em multon("G$sym",'', 'my_vars->'); - print $em "#endif\n" if $sym eq 'sh_path'; - print $em "#endif\n" if $sym eq 'perllib_sep'; -} - -print $em <<'END'; - -#endif /* PERL_GLOBAL_STRUCT */ END read_only_bottom_close_and_rename($em) if ! $error_count; -my $capih = open_print_header('perlapi.h'); - -print $capih <<'EOT'; -/* declare accessor functions for Perl variables */ -#ifndef __perlapi_h__ -#define __perlapi_h__ - -#if defined (MULTIPLICITY) && defined (PERL_GLOBAL_STRUCT) - -START_EXTERN_C - -#undef PERLVAR -#undef PERLVARA -#undef PERLVARI -#undef PERLVARIC -#define PERLVAR(p,v,t) EXTERN_C t* Perl_##p##v##_ptr(pTHX); -#define PERLVARA(p,v,n,t) typedef t PL_##v##_t[n]; \ - EXTERN_C PL_##v##_t* Perl_##p##v##_ptr(pTHX); -#define PERLVARI(p,v,t,i) PERLVAR(p,v,t) -#define PERLVARIC(p,v,t,i) PERLVAR(p,v, const t) - -#include "perlvars.h" - -#undef PERLVAR -#undef PERLVARA -#undef PERLVARI -#undef PERLVARIC - -END_EXTERN_C - -#if defined(PERL_CORE) - -/* accessor functions for Perl "global" variables */ - -/* these need to be mentioned here, or most linkers won't put them in - the perl executable */ - -#ifndef PERL_NO_FORCE_LINK - -START_EXTERN_C - -#ifndef DOINIT -EXTCONST void * const PL_force_link_funcs[]; -#else -EXTCONST void * const PL_force_link_funcs[] = { -#undef PERLVAR -#undef PERLVARA -#undef PERLVARI -#undef PERLVARIC -#define PERLVAR(p,v,t) (void*)Perl_##p##v##_ptr, -#define PERLVARA(p,v,n,t) PERLVAR(p,v,t) -#define PERLVARI(p,v,t,i) PERLVAR(p,v,t) -#define PERLVARIC(p,v,t,i) PERLVAR(p,v,t) - -/* In Tru64 (__DEC && __osf__) the cc option -std1 causes that one - * cannot cast between void pointers and function pointers without - * info level warnings. The PL_force_link_funcs[] would cause a few - * hundred of those warnings. In code one can circumnavigate this by using - * unions that overlay the different pointers, but in declarations one - * cannot use this trick. Therefore we just disable the warning here - * for the duration of the PL_force_link_funcs[] declaration. */ - -#if defined(__DECC) && defined(__osf__) -#pragma message save -#pragma message disable (nonstandcast) -#endif - -#include "perlvars.h" - -#if defined(__DECC) && defined(__osf__) -#pragma message restore -#endif - -#undef PERLVAR -#undef PERLVARA -#undef PERLVARI -#undef PERLVARIC -}; -#endif /* DOINIT */ - -END_EXTERN_C - -#endif /* PERL_NO_FORCE_LINK */ - -#else /* !PERL_CORE */ - -EOT - -foreach $sym (@globvar) { - print $capih - "#undef PL_$sym\n" . hide("PL_$sym", "(*Perl_G${sym}_ptr(NULL))"); -} - -print $capih <<'EOT'; - -#endif /* !PERL_CORE */ -#endif /* MULTIPLICITY && PERL_GLOBAL_STRUCT */ - -#endif /* __perlapi_h__ */ -EOT - -read_only_bottom_close_and_rename($capih) if ! $error_count; - -my $capi = open_print_header('perlapi.c', <<'EOQ'); - * - * - * Up to the threshold of the door there mounted a flight of twenty-seven - * broad stairs, hewn by some unknown art of the same black stone. This - * was the only entrance to the tower; ... - * - * [p.577 of _The Lord of the Rings_, III/x: "The Voice of Saruman"] - * - */ -EOQ - -print $capi <<'EOT'; -#include "EXTERN.h" -#include "perl.h" -#include "perlapi.h" - -#if defined (MULTIPLICITY) && defined (PERL_GLOBAL_STRUCT) - -/* accessor functions for Perl "global" variables */ -START_EXTERN_C - -#undef PERLVARI -#define PERLVARI(p,v,t,i) PERLVAR(p,v,t) - -#undef PERLVAR -#undef PERLVARA -#define PERLVAR(p,v,t) t* Perl_##p##v##_ptr(pTHX) \ - { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); } -#define PERLVARA(p,v,n,t) PL_##v##_t* Perl_##p##v##_ptr(pTHX) \ - { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); } -#undef PERLVARIC -#define PERLVARIC(p,v,t,i) \ - const t* Perl_##p##v##_ptr(pTHX) \ - { PERL_UNUSED_CONTEXT; return (const t *)&(PL_##v); } -#include "perlvars.h" - -#undef PERLVAR -#undef PERLVARA -#undef PERLVARI -#undef PERLVARIC - -END_EXTERN_C - -#endif /* MULTIPLICITY && PERL_GLOBAL_STRUCT */ -EOT - -read_only_bottom_close_and_rename($capi) if ! $error_count; - die "$error_count errors found" if $error_count; # ex: set ts=8 sts=4 sw=4 noet: |