Bug 1256558 - Change MUST_CONVERT to avoid C4311 in VS2015; r=khuey

This code is cherry picked from the trunk version of expat.

MozReview-Commit-ID: 8RDaArq2BwO

--HG--
extra : rebase_source : 72d9b56ec2d6d17a99e578017f0e5828ffd3aa1f
This commit is contained in:
Gregory Szorc 2016-03-21 12:00:41 -07:00
parent a74a4e5dde
commit 0f46d6549f

View File

@ -26,7 +26,9 @@
#define XmlGetInternalEncoding XmlGetUtf16InternalEncoding
#define XmlGetInternalEncodingNS XmlGetUtf16InternalEncodingNS
#define XmlEncode XmlUtf16Encode
#define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || (((unsigned long)s) & 1))
/* Using pointer subtraction to convert to integer type. */
#define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || (((char *)(s) - (char *)NULL) & 1))
typedef unsigned short ICHAR;
#else
#define XML_ENCODE_MAX XML_UTF8_ENCODE_MAX