summaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2016-01-28 15:08:01 +1100
committerTony Cook <tony@develop-help.com>2016-02-01 10:45:16 +1100
commit6f6d1bab3343e4cff9dab0934b654ade4a85bd59 (patch)
treebc17612e4f6cd22693a544e82d6836b606112029 /utf8.h
parent0bca550cf755b0872e05b868a2843e2035087f1a (diff)
downloadperl-6f6d1bab3343e4cff9dab0934b654ade4a85bd59.tar.gz
[perl #126045] part revert e9b19ab7 for vc2003 and earlier
This avoids an internal compiler error on VC 2003 and earlier
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/utf8.h b/utf8.h
index 1ed8fd8461..e523cc377b 100644
--- a/utf8.h
+++ b/utf8.h
@@ -134,10 +134,20 @@ EXTCONST unsigned char PL_utf8skip[];
END_EXTERN_C
+#if _MSC_VER < 1400
+/* older MSVC versions have a smallish macro buffer */
+#define PERL_SMALL_MACRO_BUFFER
+#endif
+
/* Native character to/from iso-8859-1. Are the identity functions on ASCII
* platforms */
+#ifdef PERL_SMALL_MACRO_BUFFER
+#define NATIVE_TO_LATIN1(ch) (ch)
+#define LATIN1_TO_NATIVE(ch) (ch)
+#else
#define NATIVE_TO_LATIN1(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch)))
#define LATIN1_TO_NATIVE(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch)))
+#endif
/* I8 is an intermediate version of UTF-8 used only in UTF-EBCDIC. We thus
* consider it to be identical to UTF-8 on ASCII platforms. Strictly speaking
@@ -145,8 +155,13 @@ END_EXTERN_C
* because they are 8-bit encodings that serve the same purpose in Perl, and
* rarely do we need to distinguish them. The term "NATIVE_UTF8" applies to
* whichever one is applicable on the current platform */
+#ifdef PERL_SMALL_MACRO_BUFFER
+#define NATIVE_UTF8_TO_I8(ch) (ch)
+#define I8_TO_NATIVE_UTF8(ch) (ch)
+#else
#define NATIVE_UTF8_TO_I8(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch)))
#define I8_TO_NATIVE_UTF8(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch)))
+#endif
/* Transforms in wide UV chars */
#define UNI_TO_NATIVE(ch) ((UV) (ch))