diff --git a/components/lazutils/lazutf8.pas b/components/lazutils/lazutf8.pas index 95f3327dab..fa065b71ee 100644 --- a/components/lazutils/lazutf8.pas +++ b/components/lazutils/lazutf8.pas @@ -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 diff --git a/components/lazutils/winlazutf8.inc b/components/lazutils/winlazutf8.inc index dac98855c7..57bad1c135 100644 --- a/components/lazutils/winlazutf8.inc +++ b/components/lazutils/winlazutf8.inc @@ -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}