LazUtf8: fix compilation for WinCE. Issue #0031788.

git-svn-id: trunk@54845 -
This commit is contained in:
bart 2017-05-09 19:21:42 +00:00
parent 92cf9781fa
commit a3a7c54e1e
2 changed files with 6 additions and 2 deletions

View File

@ -352,7 +352,7 @@ end;
function GetEnvironmentVariableCountUTF8: Integer;
begin
{$IF defined(FPC_RTL_UNICODE) or not defined(Windows)}
{$IF defined(FPC_RTL_UNICODE) or not defined(MSWindows)} //also WinCE, issue #0031788
Result:=SysUtils.GetEnvironmentVariableCount;
{$ELSE}
Result:=GetGetEnvironmentVariableCountWide;
@ -364,7 +364,7 @@ begin
{$IFDEF FPC_RTL_UNICODE}
Result:=UTF16ToUTF8(SysUtils.GetEnvironmentString(Index));
{$ELSE}
{$IFDEF Windows}
{$IFDEF MSWindows} //not for WinCE, issue #0031788
Result:=UTF16ToUTF8(GetEnvironmentStringWide(Index));
{$ELSE}
// by default the environment is in console encoding

View File

@ -222,6 +222,7 @@ begin
end;
end;
{$IFNDEF WINCE}
function GetGetEnvironmentVariableCountWide: integer;
var
hp,p : PWideChar;
@ -238,6 +239,7 @@ begin
FreeEnvironmentStringsW(p);
end;
function GetEnvironmentStringWide(Index: Integer): UnicodeString;
var
hp,p : PWideChar;
@ -255,6 +257,7 @@ begin
Result:=hp;
FreeEnvironmentStringsW(p);
end;
{$ENDIF WINCE}
function GetEnvironmentVariableWide(const EnvVar: string): UnicodeString;
{$IF FPC_FULLVERSION>=30000}
@ -287,6 +290,7 @@ begin
end;
{$ENDIF}
//*************** END WideString impementations
{$ifdef WinCE}