Description: webasm rtl.
This file as text.
(active) Revisions in this set:
33e25a3dfed57b58ba8576e846e63779e8d6c9a0,73bc8edef3ad66e208cfb30fd0df3e13f3b9fbdf,91f0f1a86c293dbf972ed684ff196244f5292af4
3836b0be04762387513cd7f6b95246cd5fc5e295,02745b0b83f9ea4e1fc98a44f753d513dfebfe62,77ca8ba16d0a5ab9aa1b261b4d1b44c94a1aa2b3
30b503abc4e628dc3c2299595ee76dba48d308fc,d9eb8d75b9f6005cc36f66da635c46f3d4aad250,387c80cc57b691c887303cc224ee01dd46684a0d
d134fc1ddfb6158945bc1751e0d2df1657f89a64,7533496505e52d2df2fa7bb3291c23adb91046c7,e078408dcf76a282a7336afeb5476c75779817cd
d45915b6ba0f99a70c51243377471bd834a5f541,bae50d80d246622a958d57c8dc70c3eff91b1b53,85ebd2c94c5fdad806ea96a1cdc3ff3400692dab
0d6b5338d0541b6a844d1d832b09b7709fe2948b,a62c7555d78f049c711cfd594455f73fa04b6620,64db584eefebcc5e5faeb287a9d10977adb4a886
25ac1380921c96b933673c8ec9f3e10da66f47d5,13c344a3a078430d212f2f523822c5810157a3d8,d7755a56f6fe705c8edfb955e0f071ac55ea5865
60d350f06788a6da9c2054f2dc2083066d9b10b7,a0e7882692432d6487acf60ae54218335f709233,27df4e98d2f1bf8e64b6037edd8d4643bd764809
aa4070ca8a2c27b818269b42c7470e5b7b03ddad,62846f54adbc08323ce660fbba6b33e1e0275d07,0bbc5a75280fa0ad0ee39e046dedd9d6d97ab90e
305393a9c11b8768a2aaa89ca8f1ff0e852ed94b,977b2f2a4bf7bda09554b034f2112d761d680517,09e61201d221bf098a42d5f994592f7df51a203f
14f361e13f82eceabe67317ba5e243d404419233,4c89eaa6cf12074ffed3b01cdcf30a6aa507aafd,05c6937fd9dd592eb643bc94d1e16c1f95dc6e82
c8d5bd77a31e088d4f5345a8294a27a75b3bf6c7,2a93340bcc22c2f6c45c22569b10a6d81ddadc56,8f95c14827ec62cfe7435e485825dff98b72a8f4
38075ac30c61c95b9371b07312eede596bf0bd22,94d8c22c6ac229faf084188fe25bc04966a47d7a,068f781c7a21335ae04ed8e63a5c18f1a841280e
00d5bb5bbc52baad3f2e268c2d51ceba4b266b04,4dc0c37678ca9102dc0de687cf27963124bf9bdf,aafb471bc880fc20a9b73cf0d60f109163793794
1e5ecccdc663ca646632cbd46a1fe5905cba99ab,809277d2b15b2c4e713cf7fc81d284429e935c2b,7f7c5785fc77b0e697c15c69be56ba7c84bf2fc9
00aa7b8ab3843aa3d5521ffc1f15cd01c4814685,4e605fb7643902e82de03ef4b43aaa166c30a42f,ca242e9ad0e3ba047fcca8cc95fb8e41599d2d0b
c4d7773c0ed87047041bbf32d8773b70b75709aa,a55980bfb85a47c711b31f6ca6ccf3ad74c66d94,099a92733113b683be425b3400f744394ae2897d
0934df505cdf94d24ff93dcd6c23eefac8799795,34587a647f791f29c0ac26fec13059e516507c40,21d843128d02fffcb8126811c16846420d570c32
b2a0df0d10aa701c4e21d215c42fb78cfdf96f62,de3ab7e46b6c7f50723da61aa992b04145cb2472,78c4585b535666f6c2f99af64dcae76c5bbc1f30
6cd88575c63e91afaf914f9ff9a1c67e60c4408a,0ead28c1e05b6eaaf53455be86d8cb3dfc97c669,090cc8fa8f7e60f2bb0fa6fa6d21d17509f39564
8e730d20db57219db3aa63bb97301a0a1591d1f1,8c39213d39eca0bfe89168734159f86bebbcbb4a,6921b968f1cdba59d2403a81c2950336ec2839af
03513720a3bab8b168cbb9707417c915d9654608
Clicking a revision will expand files
+ added except_native.inc include file (empty for now, but will provide RTL
support for the native wasm exceptions in the future)
+ RTL support for raising exceptions in native wasm exceptions mode
* don't include except.inc if wasm32 native exception is turned on, instead
replace it with except_native.inc
* longjmp in fpc_reraise changed to a throw instruction intrinsic in wasm native exceptions mode
+ implemented GetDate, GetTime and WeekDay in the WASI dos unit. They return
UTC time (I don't know how to obtain the local time zone from within WASI).
* always return error in SysUtils.FindFirst and .FindNext on the WASI platform,
in order to prevent infinite loops in tests
* instead of using the 'throw' intrinsic, set a boolean flag, in the branchful
exceptions support code
+ return a small, fake backtrace for WebAssembly, so that in case of a runtime
error, the message 'Runtime error XXX at $EEEEEEEE' appears.
+ default exception handling in WebAssembly native exceptions mode
+ implemented SysUtils.GetTickCount64 for WASI
+ implemented SysUtils.Sleep for WASI
+ implemented SysUtils.GetEnvironmentVariable, GetEnvironmentVariableCount and
GetEnvironmentString for WASI
* preopened dirs structure in the system unit modified to be a pointer to an
array of records
* preopen fd names and current dir changed to use ansistring, as well as the
parameters and result of ConvertToFdRelativePath. This will allow easier
implementation of ChDir.
* fixed handling of relative paths that are not directly relative to a preopened
dir in ConvertToFdRelativePath. This is a preparation for ChDir support.
+ implemented ChDir() for WASI
- removed the DebugWriteXXX functions from the WASI system unit, since console
output is now quite stable and can be used for debugging
* 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.)
* keep the drive string separate in the preopen and the current dir records on
the WASI platform
* replaced ['/','\'] with AllowDirectorySeparators in the WASI directory
parsing code
* replaced '/' with DirectorySeparator in the WASI directory parsing code
* another instance of ['/','\'] replaced with AllowDirectorySeparators
* use AllowDirectorySeparators, instead of checking for '/' and '\'
* use rawbytestring instead of ansistring for the WASI file name handling
+ implemented SysUtils.FileClose for WASI
+ implemented SysUtils.FileOpen for WASI
+ implemented SysUtils.FileCreate for WASI
- removed the zero constants from the implementation of SysUtils.FileOpen for WASI
+ implemented SysUtils.FileRead for WASI
* fixed WASI bug in do_read, where the result of the __wasi_fd_read syscall function was ignored
+ implemented SysUtils.FileWrite for WASI
+ implemented SysUtils.FileSeek for WASI
+ implemented SysUtils.RenameFile for WASI
- don't call ToSingleByteFileSystemEncodedFileName in SysUtils.FileOpen and
.FileCreate, because ConvertToFdRelativePath already calls it
+ implemented SysUtils.DeleteFile for WASI
+ implemented SysUtils.FileGetDate for WASI
+ implemented SysUtils.FileAge for WASI
+ implemented SysUtils.FileSetDate for WASI
+ also implemented FileSetDate(FileName) for WASI, via the __wasi_path_filestat_set_times API call
* fixed off-by-one error when initializing current_drive in the WASI system unit
+ implemented SysUtils.FileExists for WASI
* don't set InOutRes in ConvertToFdRelativePath, but return it instead. This
fixes issues in places where this function is used in a way that should not
set IOResult.
+ implemented SysUtils.DirectoryExists for WASI
+ implemented SysUtils.FileGetSymLinkTarget for WASI
* always return an error in SysUtils.FileSetAttr on WASI - this function is not supported by the WASI API
+ implemented SysUtils.FileGetAttr for WASI
+ dummy implementation of dos.SetFAttr for WASI, based on the Unix version
+ implemented DOS.GetFAttr for WASI
+ added platform-specific helper function dos.DTToWasiDate, similar to
DTToUnixDate on Unix
+ implemented dos.SetFTime for WASI
* fix for the WASI datetime to epoch conversion
+ implemented SysUtils.GetLocalTime for WASI
+ init the ansistring upper and lower case tables in the WASI SysUtils unit initialization
+ added a wrapper function around __wasi_path_readlink that calls it iteratively
with doubling buffer sizes, starting with 64 bytes, until it reaches 16384
bytes, and reads the link into a rawbytestring. Use that function in all
places in the WASI rtl that need to read a symlink.
* ConvertToFdRelativePath removed from the interface part of the WASI system
unit (to avoid cluttering the WASI system unit interface with platform
dependent routines) and added to a new unit, called wasiutil
* added the fpc_wasi_path_readlink_ansistring helper function to unit wasiutil
* the FNMatch private helper function moved from unit DOS to unit WasiUtil, and
changed to have rawbytestring parameters, so it can be used from SysUtils as
well.
- removed unused, commented out fields from the RtlInfoType record
- removed the RtlInfoType record, because it is only used only once in a local
variable. Use an anonymous record instead.
* moved the FindFirst/FindNext/FindClose code from unit DOS to WasiUtil, using
RawByteString. This will allow to reuse the same implementation in SysUtils.
+ implemented FindFirst, FindNext and FindClose in SysUtils for the WASI platform
+ implemented DOS.FSearch for WASI
- removed TWasiSearchRec.Mode, because it was unused
* fixed range check error in the DOS unit