This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.h: Combine EBCDIC and ASCII macros
authorKarl Williamson <khw@cpan.org>
Fri, 6 Nov 2015 18:03:22 +0000 (11:03 -0700)
committerKarl Williamson <khw@cpan.org>
Sun, 6 Dec 2015 05:06:50 +0000 (22:06 -0700)
The previous commits have made these macros be the exact same text, so
can be combined, and defined just once.  This requires moving them to
the portion of the file that is common with both EBCDIC and ASCII.

The commit diff shows instead other code being moved.

utf8.h
utfebcdic.h

diff --git a/utf8.h b/utf8.h
index 129356e..acadbb5 100644 (file)
--- a/utf8.h
+++ b/utf8.h
@@ -265,6 +265,15 @@ Perl's extended UTF-8 means we can have start bytes up to FF.
 #   define __BASE_UNI_SKIP(uv) (__COMMON_UNI_SKIP(uv) 7)
 #endif
 
+/* ^? is defined to be DEL on ASCII systems.  See the definition of toCTRL()
+ * for more */
+#define QUESTION_MARK_CTRL  DEL_NATIVE
+
+/* Surrogates, non-character code points and above-Unicode code points are
+ * problematic in some contexts.  This allows code that needs to check for
+ * those to to quickly exclude the vast majority of code points it will
+ * encounter */
+#define isUTF8_POSSIBLY_PROBLEMATIC(c) ((U8) c >= 0xED)
 #define OFFUNISKIP(uv) ( OFFUNI_IS_INVARIANT(uv) ? 1 : __BASE_UNI_SKIP(uv))
 /*
 
@@ -277,15 +286,6 @@ encoded as UTF-8.  C<cp> is a native (ASCII or EBCDIC) code point if less than
  */
 #define UVCHR_SKIP(uv) ( UVCHR_IS_INVARIANT(uv) ? 1 : __BASE_UNI_SKIP(uv))
 
-/* ^? is defined to be DEL on ASCII systems.  See the definition of toCTRL()
- * for more */
-#define QUESTION_MARK_CTRL  DEL_NATIVE
-
-/* Surrogates, non-character code points and above-Unicode code points are
- * problematic in some contexts.  This allows code that needs to check for
- * those to to quickly exclude the vast majority of code points it will
- * encounter */
-#define isUTF8_POSSIBLY_PROBLEMATIC(c) ((U8) c >= 0xED)
 
 #endif /* EBCDIC vs ASCII */
 
index d7716f2..e306122 100644 (file)
@@ -201,11 +201,6 @@ above what a 64 bit word can hold */
                             (uv) < 0x4000000   ? 6 :                  \
                             (uv) < 0x40000000  ? 7 : UTF8_MAXBYTES )
 
-/* Input is a true Unicode (not-native) code point */
-#define OFFUNISKIP(uv) ( OFFUNI_IS_INVARIANT(uv) ? 1 : __BASE_UNI_SKIP(uv))
-
-#define UVCHR_SKIP(uv) ( UVCHR_IS_INVARIANT(uv) ? 1 : _BASE_UNI_SKIP(uv))
-
 /* UTF-EBCDIC semantic macros - We used to transform back into I8 and then
  * compare, but now only have to do a single lookup by using a bit in
  * l1_char_class_tab.h.