summaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2016-02-01 13:22:53 +1100
committerTony Cook <tony@develop-help.com>2016-02-01 13:22:53 +1100
commit1a3756de64921fe45a9e00f0c8bba3c75e843bca (patch)
treed12dcb99a32e2a1193479430f093cd2f649c4f47 /utf8.h
parent022b5ce0daff9a15025b29dcaf79dbd411fe1dda (diff)
downloadperl-1a3756de64921fe45a9e00f0c8bba3c75e843bca.tar.gz
[perl #127426] fixes for 126045 patch, restrict to MSVC, add casts
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/utf8.h b/utf8.h
index e523cc377b..b41a53af87 100644
--- a/utf8.h
+++ b/utf8.h
@@ -134,7 +134,7 @@ EXTCONST unsigned char PL_utf8skip[];
END_EXTERN_C
-#if _MSC_VER < 1400
+#if defined(_MSC_VER) && _MSC_VER < 1400
/* older MSVC versions have a smallish macro buffer */
#define PERL_SMALL_MACRO_BUFFER
#endif
@@ -142,8 +142,8 @@ END_EXTERN_C
/* 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)
+#define NATIVE_TO_LATIN1(ch) ((U8)(ch))
+#define LATIN1_TO_NATIVE(ch) ((U8)(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)))