/* warnings (9) */
{
SV *mask = NULL;
-#if XSH_HAS_PERL(5, 9, 4)
+#if XSH_HAS_PERL(5, 37, 6)
+ char *old_warnings = cop->cop_warnings;
+#elif XSH_HAS_PERL(5, 9, 4)
STRLEN *old_warnings = cop->cop_warnings;
#else
SV *old_warnings = cop->cop_warnings;
if (!mask)
mask = su_newmortal_pvn(WARN_ALLstring, WARNsize);
} else {
-#if XSH_HAS_PERL(5, 9, 4)
+#if XSH_HAS_PERL(5, 37, 6)
+ mask = su_newmortal_pvn((char *) old_warnings, RCPV_LEN(old_warnings));
+#elif XSH_HAS_PERL(5, 9, 4)
mask = su_newmortal_pvn((char *) (old_warnings + 1), old_warnings[0]);
#else
mask = sv_mortalcopy(old_warnings);