This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Dispatch signals in infinite loops such as 1 while 1;
[perl5.git] / perl.h
diff --git a/perl.h b/perl.h
index 2f02ba4..960ba1a 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -1311,6 +1311,24 @@ EXTERN_C char *crypt(const char *, const char *);
 #endif
 
 #define ERRSV GvSVn(PL_errgv)
+
+#define CLEAR_ERRSV() STMT_START {                                     \
+    if (!GvSV(PL_errgv)) {                                             \
+       sv_setpvs(GvSV(gv_add_by_type(PL_errgv, SVt_PV)), "");          \
+    } else if (SvREADONLY(GvSV(PL_errgv))) {                           \
+       SvREFCNT_dec(GvSV(PL_errgv));                                   \
+       GvSV(PL_errgv) = newSVpvs("");                                  \
+    } else {                                                           \
+       SV *const errsv = GvSV(PL_errgv);                               \
+       sv_setpvs(errsv, "");                                           \
+       if (SvMAGICAL(errsv)) {                                         \
+           mg_free(errsv);                                             \
+       }                                                               \
+       SvPOK_only(errsv);                                              \
+    }                                                                  \
+    } STMT_END
+
+
 #ifdef PERL_CORE
 # define DEFSV (0 + GvSVn(PL_defgv))
 #else
@@ -3800,8 +3818,10 @@ Gid_t getegid (void);
 
 
 #define DEBUG_SCOPE(where) \
-    DEBUG_l(WITH_THR(Perl_deb(aTHX_ "%s scope %ld at %s:%d\n", \
-                   where, (long)PL_scopestack_ix, __FILE__, __LINE__)));
+    DEBUG_l(WITH_THR( \
+    Perl_deb(aTHX_ "%s scope %ld (savestack=%ld) at %s:%d\n",  \
+                   where, (long)PL_scopestack_ix, (long)PL_savestack_ix, \
+                   __FILE__, __LINE__)));
 
 
 
@@ -4755,7 +4775,7 @@ enum {            /* pass one of these to get_vtbl */
 #define HINT_BLOCK_SCOPE       0x00000100
 #define HINT_STRICT_SUBS       0x00000200 /* strict pragma */
 #define HINT_STRICT_VARS       0x00000400 /* strict pragma */
-#define HINT_NOT_UNI_8_BIT     0x00000800 /* unicode8bit pragma */
+#define HINT_UNI_8_BIT         0x00000800 /* unicode_strings feature */
 
 /* The HINT_NEW_* constants are used by the overload pragma */
 #define HINT_NEW_INTEGER       0x00001000
@@ -6129,8 +6149,6 @@ extern void moncontrol(int);
 
 #endif /* Include guard */
 
-#define CLEAR_ERRSV() STMT_START { sv_setpvn(ERRSV,"",0); if (SvMAGICAL(ERRSV)) { mg_free(ERRSV); } SvPOK_only(ERRSV); } STMT_END
-
 /*
  * Local variables:
  * c-indentation-style: bsd