* Ensure compilation with older FPC versions (Work by Christian Ulrich)

git-svn-id: trunk@38640 -
This commit is contained in:
michael 2018-03-28 07:37:03 +00:00
parent e9ca615924
commit b1626d7c0b

View File

@ -525,13 +525,23 @@ procedure TFPFontCacheList.ReadStandardFonts;
{$ifdef mswindows}
function GetWinFontsDir: string;
var
{$if FPC_FULLVERSION < 30400}
w : Array[0..MaxPathLen] of Char;
{$ELSE}
w : pwidechar;
{$ENDIF}
begin
{$if FPC_FULLVERSION < 30400}
SHGetSpecialFolderPath(0,w,CSIDL_FONTS,false);
{$else}
SHGetKnownFolderPath(FOLDERID_Fonts,0,0,w);
{$endif}
Result := w;
{$if FPC_FULLVERSION > 30400}
CoTaskMemFree(w);
{$endif}
end;
{$endif}
{$endif}
{$ifdef HasFontsConf}
var
@ -694,3 +704,4 @@ finalization
end.