Skip to content

Commit

Permalink
See if we can find out where the bug is.
Browse files Browse the repository at this point in the history
  • Loading branch information
lerno committed Jul 13, 2023
1 parent c7d90ba commit 948180e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ jobs:
- name: Compile and run some examples
run: |
cd resources
..\build\${{ matrix.build_type }}\c3c.exe compile-run examples\hello_world_many.c3
..\build\${{ matrix.build_type }}\c3c.exe compile-run examples\time.c3
..\build\${{ matrix.build_type }}\c3c.exe compile-run examples\fannkuch-redux.c3
..\build\${{ matrix.build_type }}\c3c.exe compile-run examples\contextfree\boolerr.c3
..\build\${{ matrix.build_type }}\c3c.exe compile-run examples\ls.c3
..\build\${{ matrix.build_type }}\c3c.exe compile-run examples\load_world.c3
..\build\${{ matrix.build_type }}\c3c.exe compile-run examples\process.c3
- name: Build testproject
Expand Down Expand Up @@ -103,11 +97,6 @@ jobs:
- name: Compile and run some examples
run: |
cd resources
../build/c3c compile-run examples/hello_world_many.c3
../build/c3c compile-run examples/time.c3
../build/c3c compile-run examples/fannkuch-redux.c3
../build/c3c compile-run examples/contextfree/boolerr.c3
../build/c3c compile-run examples/load_world.c3
../build/c3c compile-run examples/load_world.c3
- name: Build testproject
Expand Down Expand Up @@ -159,10 +148,6 @@ jobs:
- name: Compile and run some examples
run: |
cd resources
../build/c3c compile-run examples/hello_world_many.c3
../build/c3c compile-run examples/time.c3
../build/c3c compile-run examples/fannkuch-redux.c3
../build/c3c compile-run examples/contextfree/boolerr.c3
../build/c3c compile-run examples/load_world.c3
- name: Build testproject
Expand Down
4 changes: 3 additions & 1 deletion lib/std/io/os/file_libc.c3
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ import libc;
**/
fn void*! native_fopen(String filename, String mode) @inline
{
libc::printf("Got here\n");
@pool()
{
$if env::WIN32:
void* file = libc::_wfopen(filename.to_temp_wstring(), filename.to_temp_wstring())!;
$else
void* file = libc::fopen(filename.zstr_tcopy(), mode.zstr_tcopy());
$endif
return file ?: file_open_errno()?;
libc::printf("Got herfffe\n");
return file ?: IoError.FILE_NOT_FOUND?;
};
}

Expand Down
22 changes: 16 additions & 6 deletions resources/examples/load_world.c3
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
module load_world;
import std::io;
import libc;
fn void! main()
{
File f = file::open("examples/hello_world.txt", "rb")!;
defer f.close()!!;
while (!f.eof())
native_fopen2("examples/hello_world.txt", "rb")!;
}


fn void*! native_fopen2(String filename, String mode)
{
@pool()
{
@pool() { io::printn(f.tgetline()); };
}
}
$if env::WIN32:
void* file = libc::_wfopen(filename.to_temp_wstring(), filename.to_temp_wstring())!;
$else
void* file = libc::fopen(filename.zstr_tcopy(), mode.zstr_tcopy());
$endif
return null;
};
}
2 changes: 1 addition & 1 deletion src/compiler/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -1769,7 +1769,7 @@ void target_setup(BuildTarget *target)
{
if (platform_target.os == OS_TYPE_WIN32)
{
target->debug_info = DEBUG_INFO_NONE;
target->debug_info = DEBUG_INFO_FULL;
}
else
{
Expand Down

0 comments on commit 948180e

Please sign in to comment.