Fix pas2c build
authorunc0rr
Sat, 02 Apr 2016 10:45:33 +0300
changeset 11643 3bff941c035f
parent 11642 c82a0a886779
child 11644 f17df78181d8
Fix pas2c build
hedgewars/pas2cSystem.pas
hedgewars/uPhysFSLayer.pas
--- a/hedgewars/pas2cSystem.pas	Fri Apr 01 15:36:19 2016 +0200
+++ b/hedgewars/pas2cSystem.pas	Sat Apr 02 10:45:33 2016 +0300
@@ -130,10 +130,12 @@
     clear_filelist_hook, add_file_hook, idb_loader_hook, mainloop_hook, drawworld_hook : procedure;
     SDL_InitPatch : procedure;
 
-    PHYSFS_init, PHYSFS_deinit, PHYSFS_mount, PHYSFS_readBytes, PHYSFS_read : function : LongInt;
-    PHYSFSRWOPS_openRead, PHYSFSRWOPS_openWrite, PHYSFS_openRead : function : pointer;
-    PHYSFS_eof, PHYSFS_close, PHYSFS_exists : function : boolean;
+    PHYSFS_init, PHYSFS_deinit, PHYSFS_mount, PHYSFS_readBytes, PHYSFS_writeBytes, PHYSFS_read : function : LongInt;
+    PHYSFSRWOPS_openRead, PHYSFSRWOPS_openWrite, PHYSFS_openRead, PHYSFS_openWrite : function : pointer;
+    PHYSFS_eof, PHYSFS_close, PHYSFS_exists, PHYSFS_mkdir, PHYSFS_flush, PHYSFS_setWriteDir : function : boolean;
     PHYSFS_getLastError : function : PChar;
+    PHYSFS_enumerateFiles : function : PPChar;
+    PHYSFS_freeList : procedure;
 
     hedgewarsMountPackages, physfsReaderSetBuffer, hedgewarsMountPackage : procedure;
     physfsReader : function : pointer;
--- a/hedgewars/uPhysFSLayer.pas	Fri Apr 01 15:36:19 2016 +0200
+++ b/hedgewars/uPhysFSLayer.pas	Sat Apr 02 10:45:33 2016 +0300
@@ -179,15 +179,15 @@
         pfsBlockRead:= r
 end;
 
-procedure pfsMount(path: ansistring; mountpoint: PChar);
+procedure pfsMount(path: PChar; mountpoint: PChar);
 begin
-    if PHYSFS_mount(PChar(path), mountpoint, false) then
-        //AddFileLog('[PhysFS] mount ' + shortstring(path) + ' at ' + shortstring(mountpoint) + ' : ok')
+    if PHYSFS_mount(path, mountpoint, false) then
+        AddFileLog('[PhysFS] mount ' + shortstring(path) + ' at ' + shortstring(mountpoint) + ' : ok')
     else
-        //AddFileLog('[PhysFS] mount ' + shortstring(path) + ' at ' + shortstring(mountpoint) + ' : FAILED ("' + shortstring(PHYSFS_getLastError()) + '")');
+        AddFileLog('[PhysFS] mount ' + shortstring(path) + ' at ' + shortstring(mountpoint) + ' : FAILED ("' + shortstring(PHYSFS_getLastError()) + '")');
 end;
 
-procedure pfsMountAtRoot(path: ansistring);
+procedure pfsMountAtRoot(path: PChar);
 begin
     pfsMount(path, PChar(_S'/'));
 end;
@@ -215,7 +215,7 @@
         begin
             fp := cFontsPaths[i];
             if fp <> nil then
-                pfsMount(ansistring(fp), _P'/Fonts');
+                pfsMount(fp, _P'/Fonts');
         end;
 {$ENDIF}
 
@@ -223,7 +223,7 @@
     pfsMount(userPrefix, PChar('/Config'));
     pfsMakeDir('/Config/Data');
     pfsMakeDir('/Config/Logs');
-    pfsMountAtRoot(userPrefix + ansistring('/Data'));
+    pfsMountAtRoot(Str2PChar(shortstring(userPrefix) + '/Data'));
     PHYSFS_setWriteDir(userPrefix);
 
     hedgewarsMountPackages;
@@ -233,7 +233,7 @@
 
     if cTestLua then
         begin
-            pfsMountAtRoot(ansistring(ExtractFileDir(cScriptName)));
+            pfsMountAtRoot(Str2PChar(ExtractFileDir(cScriptName)));
             cScriptName := ExtractFileName(cScriptName);
         end;
 end;