This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Stop leaking temporary version objects from XS
[perl5.git] / handy.h
diff --git a/handy.h b/handy.h
index 3f44c69..3d2d46a 100644 (file)
--- a/handy.h
+++ b/handy.h
@@ -664,16 +664,9 @@ parameter, casts can silently truncate and yield wrong results.
 #define isPSXSPC_LC_utf8(c)    (isSPACE_LC_utf8(c) ||(c) == '\f')
 #define isBLANK_LC_utf8(c)     isBLANK(c) /* could be wrong */
 
-#ifdef EBCDIC
-#  ifdef PERL_IMPLICIT_CONTEXT
-#    define toCTRL(c)     Perl_ebcdic_control(aTHX_ c)
-#  else
-#    define toCTRL        Perl_ebcdic_control
-#  endif
-#else
-  /* This conversion works both ways, strangely enough. */
-#  define toCTRL(c)    (toUPPER(c) ^ 64)
-#endif
+/* This conversion works both ways, strangely enough. On EBCDIC platforms,
+ * CTRL-@ is 0, CTRL-A is 1, etc, just like on ASCII */
+#  define toCTRL(c)    (toUPPER(NATIVE_TO_UNI(c)) ^ 64)
 
 /* Line numbers are unsigned, 32 bits. */
 typedef U32 line_t;
@@ -923,6 +916,7 @@ void Perl_mem_log_del_sv(const SV *sv, const char *filename, const int linenumbe
 #endif
 
 #define C_ARRAY_LENGTH(a)      (sizeof(a)/sizeof((a)[0]))
+#define C_ARRAY_END(a)         (a) + (sizeof(a)/sizeof((a)[0]))
 
 #ifdef NEED_VA_COPY
 # ifdef va_copy