mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- new_* functions in general moved to version without new_ prefix.
- `string::new_from_*` changed to `string::from_*`. - `String.to_utf16_copy` and related changed to `String.to_utf16`. - `String.to_utf16_tcopy` and related changed to `String.to_temp_utf16` - `mem::temp_new` changed to `mem::tnew`. - `mem::temp_alloc` and related changed to `mem::talloc`. - `mem::temp_new_array` changed to `mem::temp_array`.
This commit is contained in:
committed by
Christoffer Lerno
parent
b35aafd3d5
commit
c40198b016
@@ -8,7 +8,7 @@ import libc;
|
||||
fn void*! native_fopen(String filename, String mode) @inline => @pool()
|
||||
{
|
||||
$if env::WIN32:
|
||||
void* file = libc::_wfopen(filename.to_wstring_tcopy(), mode.to_wstring_tcopy())!;
|
||||
void* file = libc::_wfopen(filename.to_temp_wstring(), mode.to_temp_wstring())!;
|
||||
$else
|
||||
void* file = libc::fopen(filename.zstr_tcopy(), mode.zstr_tcopy());
|
||||
$endif
|
||||
@@ -18,7 +18,7 @@ fn void*! native_fopen(String filename, String mode) @inline => @pool()
|
||||
fn void! native_remove(String filename) => @pool()
|
||||
{
|
||||
$if env::WIN32:
|
||||
CInt result = libc::_wremove(filename.to_wstring_tcopy())!;
|
||||
CInt result = libc::_wremove(filename.to_temp_wstring())!;
|
||||
$else
|
||||
CInt result = libc::remove(filename.zstr_tcopy());
|
||||
$endif
|
||||
@@ -42,7 +42,7 @@ fn void! native_remove(String filename) => @pool()
|
||||
fn void*! native_freopen(void* file, String filename, String mode) @inline => @pool()
|
||||
{
|
||||
$if env::WIN32:
|
||||
file = libc::_wfreopen(filename.to_wstring_tcopy(), mode.to_wstring_tcopy(), file)!;
|
||||
file = libc::_wfreopen(filename.to_temp_wstring(), mode.to_temp_wstring(), file)!;
|
||||
$else
|
||||
file = libc::freopen(filename.zstr_tcopy(), mode.zstr_tcopy(), file);
|
||||
$endif
|
||||
|
||||
Reference in New Issue
Block a user