Skip to content

Commit

Permalink
Fix macro issue in Intl-ICU
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhorton committed Nov 13, 2017
1 parent 7a385e0 commit dc0869f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ namespace Js
return scriptContext->GetLibrary()->GetUndefined();
}

JavascriptString* toReturn = nullptr;
Var toReturn = nullptr;
ENTER_PINNED_SCOPE(JavascriptString, localeStrings);
localeStrings = JavascriptString::FromVar(args.Values[1]);
PCWSTR passedLocale = localeStrings->GetSz();
Expand All @@ -690,14 +690,16 @@ namespace Js
char16 resolvedLocaleName[ULOC_FULLNAME_CAPACITY] = { 0 };
if (ResolveLocaleBestFit(passedLocale, resolvedLocaleName))
{
return JavascriptString::NewCopySz(resolvedLocaleName, scriptContext);
toReturn = JavascriptString::NewCopySz(resolvedLocaleName, scriptContext);
}

else
{
#ifdef INTL_ICU_DEBUG
Output::Print(_u("Intl::ResolveLocaleBestFit returned false: EntryIntl_ResolveLocaleBestFit returning null to fallback to JS\n"));
Output::Print(_u("Intl::ResolveLocaleBestFit returned false: EntryIntl_ResolveLocaleBestFit returning null to fallback to JS\n"));
#endif
return scriptContext->GetLibrary()->GetNull();
#else
toReturn = scriptContext->GetLibrary()->GetNull();
}
#else // !INTL_ICU
DelayLoadWindowsGlobalization* wgl = scriptContext->GetThreadContext()->GetWindowsGlobalizationLibrary();
WindowsGlobalizationAdapter* wga = GetWindowsGlobalizationAdapter(scriptContext);

Expand All @@ -718,10 +720,11 @@ namespace Js

toReturn = JavascriptString::NewCopySz(wgl->WindowsGetStringRawBuffer(*locale, NULL), scriptContext);

#endif

LEAVE_PINNED_SCOPE(); // localeStrings

return toReturn;
#endif
}

Var IntlEngineInterfaceExtensionObject::EntryIntl_GetDefaultLocale(RecyclableObject* function, CallInfo callInfo, ...)
Expand Down

0 comments on commit dc0869f

Please sign in to comment.