From 2be8f3b9aad818cb29dd63302f76feed0034da39 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 24 Mar 2024 11:47:23 -0700 Subject: [PATCH] Add github msys2 workflow --- .github/workflows/windows.yml | 19 +++++++++++++++++++ configure | 2 +- line.c | 16 ++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/windows.yml create mode 100644 line.c diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..7640016 --- /dev/null +++ b/.github/workflows/windows.yml @@ -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 diff --git a/configure b/configure index 0d94402..3fbb863 100755 --- a/configure +++ b/configure @@ -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"' ;; diff --git a/line.c b/line.c new file mode 100644 index 0000000..99ce4d8 --- /dev/null +++ b/line.c @@ -0,0 +1,16 @@ +#include +#include +int main(void) { + char line[256]; + puts("hello"); + FILE *f = fopen("b", "w"); + fputs("hello\n", f); + fclose(f); + FILE *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(r); +}