From 63412bf0ec2f6bab77e60dddfb5fc65d0dd95a74 Mon Sep 17 00:00:00 2001 From: John Abd-El-Malek Date: Thu, 19 Jun 2014 08:07:13 -0700 Subject: Fix JS_WIDESTRING to work with clang-cl MSVC lexes L#macro_arg as a single wide string literal token, but Clang and other C/C++ compliant lexers do not. There was already a workaround to use implicit string concatenation for GCC, but there's a simpler solution of token pasting the L onto the stringized macro argument with 'L###macro_arg'. This works with Clang, GCC, and MSVC. R=jun_fang@foxitsoftware.com, jam@chromium.org BUG=82385 Original patch by Reid Kleckner Review URL: https://codereview.chromium.org/345643002 --- AUTHORS | 1 + fpdfsdk/include/javascript/JS_Define.h | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/AUTHORS b/AUTHORS index 1d2ef49de8..0d72e22dda 100644 --- a/AUTHORS +++ b/AUTHORS @@ -20,6 +20,7 @@ Lucas Nihlen Matt Giuca Nico Weber Raymes Khoury +Reid Kleckner Foxit Software Inc <*@foxitsoftware.com> Google Inc. <*@google.com> diff --git a/fpdfsdk/include/javascript/JS_Define.h b/fpdfsdk/include/javascript/JS_Define.h index cc20333706..ba978e9e2d 100644 --- a/fpdfsdk/include/javascript/JS_Define.h +++ b/fpdfsdk/include/javascript/JS_Define.h @@ -44,11 +44,7 @@ typedef CFX_WideString JS_ErrorString; #define CJS_IntArray CFX_ArrayTemplate /* ====================================== PUBLIC DEFINE SPEC ============================================== */ -#ifndef __GNUC__ -#define JS_WIDESTRING(widestring) L#widestring -#else -#define JS_WIDESTRING(widestring) L""#widestring -#endif +#define JS_WIDESTRING(widestring) L###widestring #define OBJ_PROP_PARAMS IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError #define OBJ_METHOD_PARAMS IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError -- cgit v1.2.3