Skip to content

Commit

Permalink
Add github msys2 workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelforney committed Mar 25, 2024
1 parent 4f902b5 commit 5430e35
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on: push
jobs:
build:
runs-on: windows-latest
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: msys
install: gcc make diffutils
- uses: actions/checkout@v4
- shell: msys2 {0}
run: |
./configure
gcc line.c
./a.exe | od -t ax1
od -t ax1 b
od -t ax1 c
od -t ax1 test/basic.c
make all check bootstrap
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ case "$target" in
endfiles='"-l", "c", "-l", ":crtn.o"'
defines='"-D", "__builtin_stdarg_start(ap, last)=__builtin_va_start(ap, last)"'
;;
*-*msys*)
*-msys*)
startfiles='"-l", ":crt0.o"'
endfiles='"-l", "c", "-l", "msys-2.0", "-l", "kernel32"'
;;
Expand Down
16 changes: 16 additions & 0 deletions line.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <string.h>
#include <stdio.h>
int main(void) {
char line[256];
puts("hello");
FILE *f = fopen("b", "w");
fputs("hello\n", f);
fclose(f);
f = fopen("c", "wt");
fputs("hello\n", f);
fclose(f);
f = fopen("test/basic.c", "r");
fgets(line, sizeof line, f);
fprintf(stderr, "c=%d %d\n", line[strlen(line) - 2], line[strlen(line) - 1]);
fclose(f);
}

0 comments on commit 5430e35

Please sign in to comment.