Browse Source

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

git-svn-id: trunk@38640 -
michael 7 years ago
parent
commit
b1626d7c0b
1 changed files with 12 additions and 1 deletions
  1. 12 1
      packages/fcl-pdf/src/fpttf.pp

+ 12 - 1
packages/fcl-pdf/src/fpttf.pp

@@ -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.
 
+