small webassembly fix
parent
c00be49d91
commit
4c07df6a21
|
@ -114,7 +114,7 @@ fn parse_windows_cmd_line(cmd byteptr) []string {
|
||||||
// read_file reads the file in `path` and returns the contents.
|
// read_file reads the file in `path` and returns the contents.
|
||||||
pub fn read_file(path string) ?string {
|
pub fn read_file(path string) ?string {
|
||||||
mode := 'rb'
|
mode := 'rb'
|
||||||
mut fp := &C.FILE{}
|
mut fp := &C.FILE{!}
|
||||||
$if windows {
|
$if windows {
|
||||||
fp = C._wfopen(path.to_wide(), mode.to_wide())
|
fp = C._wfopen(path.to_wide(), mode.to_wide())
|
||||||
} $else {
|
} $else {
|
||||||
|
@ -162,7 +162,7 @@ pub fn read_lines(path string) []string {
|
||||||
mut buf := malloc(buf_len)
|
mut buf := malloc(buf_len)
|
||||||
|
|
||||||
mode := 'rb'
|
mode := 'rb'
|
||||||
mut fp := &C.FILE{}
|
mut fp := &C.FILE{!}
|
||||||
$if windows {
|
$if windows {
|
||||||
fp = C._wfopen(path.to_wide(), mode.to_wide())
|
fp = C._wfopen(path.to_wide(), mode.to_wide())
|
||||||
} $else {
|
} $else {
|
||||||
|
|
Loading…
Reference in New Issue