Pārlūkot izejas kodu

* moved the preopened dir and current dir handling types and variables to the
implementation part of the system unit, so their implementation is not exposed
and can be changed in the future (e.g. for thread safety when WebAssembly
gets multithreading support, etc.)

Nikolay Nikolov 4 gadi atpakaļ
vecāks
revīzija
64db584eef
1 mainītis faili ar 17 papildinājumiem un 15 dzēšanām
  1. 17 15
      rtl/wasi/system.pp

+ 17 - 15
rtl/wasi/system.pp

@@ -48,6 +48,23 @@ const
   sLineBreak = LineEnding;
   DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsLF;
 
+var
+  argc: longint;
+  argv: PPChar;
+  envp: PPChar;
+
+function ConvertToFdRelativePath(path: ansistring; out fd: LongInt; out relfd_path: ansistring): Boolean;
+
+implementation
+
+{$I wasitypes.inc}
+{$I wasiprocs.inc}
+
+function HasDriveLetter(const path: rawbytestring): Boolean;
+begin
+  HasDriveLetter:=(path<>'') and (UpCase(path[1]) in ['A'..'Z']) and (path[2] = ':');
+end;
+
 type
   PPreopenedDir = ^TPreopenedDir;
   TPreopenedDir = record
@@ -60,27 +77,12 @@ type
   end;
 
 var
-  argc: longint;
-  argv: PPChar;
-  envp: PPChar;
   preopened_dirs_count: longint;
   preopened_dirs: PPreopenedDir;
   drives_count: longint;
   current_dirs: PCurrentDir;
   current_drive: longint;
 
-function ConvertToFdRelativePath(path: ansistring; out fd: LongInt; out relfd_path: ansistring): Boolean;
-
-implementation
-
-{$I wasitypes.inc}
-{$I wasiprocs.inc}
-
-function HasDriveLetter(const path: rawbytestring): Boolean;
-begin
-  HasDriveLetter:=(path<>'') and (UpCase(path[1]) in ['A'..'Z']) and (path[2] = ':');
-end;
-
 {$I system.inc}
 
 var