summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-08-07 21:09:03 +0200
committerNicholas Clark <nick@ccl4.org>2011-08-11 11:38:46 +0200
commit115ff745268490ae5fb5ecaee00be54172e302e0 (patch)
tree18788de5ba03a4598d0cdd3b776e2dd257df050f /ext
parente469e61f2b416389b7fb67acaf0d21735066e6ee (diff)
downloadperl-115ff745268490ae5fb5ecaee00be54172e302e0.tar.gz
Simplify embedvar.h, removing a level of macro indirection for PL_* variables.
For the default (non-multiplicity) configuration, PERLVAR*() macros now directly expand their arguments to tokens such as C<PL_defgv>, instead of expanding to C<PL_Idefgv>. This removes over 350 lines from F<embedvar.h>, which defined macros to map from C<PL_Idefgv> to C<PL_defgv> and so forth.
Diffstat (limited to 'ext')
-rw-r--r--ext/B/B.pm2
-rw-r--r--ext/B/B.xs32
2 files changed, 17 insertions, 17 deletions
diff --git a/ext/B/B.pm b/ext/B/B.pm
index da20925ae5..2f18065e4a 100644
--- a/ext/B/B.pm
+++ b/ext/B/B.pm
@@ -15,7 +15,7 @@ require Exporter;
# walkoptree comes from B.xs
BEGIN {
- $B::VERSION = '1.30';
+ $B::VERSION = '1.31';
@B::EXPORT_OK = ();
# Our BOOT code needs $VERSION set, and will append to @EXPORT_OK.
diff --git a/ext/B/B.xs b/ext/B/B.xs
index 901554968f..0c44e45bad 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -609,10 +609,10 @@ typedef struct refcounted_he *B__RHE;
#endif
#ifdef MULTIPLICITY
-# define ASSIGN_COMMON_ALIAS(var) \
- STMT_START { XSANY.any_i32 = offsetof(struct interpreter, var); } STMT_END
+# define ASSIGN_COMMON_ALIAS(prefix, var) \
+ STMT_START { XSANY.any_i32 = offsetof(struct interpreter, prefix##var); } STMT_END
#else
-# define ASSIGN_COMMON_ALIAS(var) \
+# define ASSIGN_COMMON_ALIAS(prefix, var) \
STMT_START { XSANY.any_ptr = (void *)&PL_##var; } STMT_END
#endif
@@ -657,35 +657,35 @@ BOOT:
specialsv_list[6] = (SV *) pWARN_STD;
cv = newXS("B::init_av", intrpvar_sv_common, file);
- ASSIGN_COMMON_ALIAS(Iinitav);
+ ASSIGN_COMMON_ALIAS(I, initav);
cv = newXS("B::check_av", intrpvar_sv_common, file);
- ASSIGN_COMMON_ALIAS(Icheckav_save);
+ ASSIGN_COMMON_ALIAS(I, checkav_save);
#if PERL_VERSION >= 9
cv = newXS("B::unitcheck_av", intrpvar_sv_common, file);
- ASSIGN_COMMON_ALIAS(Iunitcheckav_save);
+ ASSIGN_COMMON_ALIAS(I, unitcheckav_save);
#endif
cv = newXS("B::begin_av", intrpvar_sv_common, file);
- ASSIGN_COMMON_ALIAS(Ibeginav_save);
+ ASSIGN_COMMON_ALIAS(I, beginav_save);
cv = newXS("B::end_av", intrpvar_sv_common, file);
- ASSIGN_COMMON_ALIAS(Iendav);
+ ASSIGN_COMMON_ALIAS(I, endav);
cv = newXS("B::main_cv", intrpvar_sv_common, file);
- ASSIGN_COMMON_ALIAS(Imain_cv);
+ ASSIGN_COMMON_ALIAS(I, main_cv);
cv = newXS("B::inc_gv", intrpvar_sv_common, file);
- ASSIGN_COMMON_ALIAS(Iincgv);
+ ASSIGN_COMMON_ALIAS(I, incgv);
cv = newXS("B::defstash", intrpvar_sv_common, file);
- ASSIGN_COMMON_ALIAS(Idefstash);
+ ASSIGN_COMMON_ALIAS(I, defstash);
cv = newXS("B::curstash", intrpvar_sv_common, file);
- ASSIGN_COMMON_ALIAS(Icurstash);
+ ASSIGN_COMMON_ALIAS(I, curstash);
cv = newXS("B::formfeed", intrpvar_sv_common, file);
- ASSIGN_COMMON_ALIAS(Iformfeed);
+ ASSIGN_COMMON_ALIAS(I, formfeed);
#ifdef USE_ITHREADS
cv = newXS("B::regex_padav", intrpvar_sv_common, file);
- ASSIGN_COMMON_ALIAS(Iregex_padav);
+ ASSIGN_COMMON_ALIAS(I, regex_padav);
#endif
cv = newXS("B::warnhook", intrpvar_sv_common, file);
- ASSIGN_COMMON_ALIAS(Iwarnhook);
+ ASSIGN_COMMON_ALIAS(I, warnhook);
cv = newXS("B::diehook", intrpvar_sv_common, file);
- ASSIGN_COMMON_ALIAS(Idiehook);
+ ASSIGN_COMMON_ALIAS(I, diehook);
}
long