From f5ed441ddbd9125f902d0b6c8551a16679ba1ebd Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 8 Jan 2024 00:02:33 -0700 Subject: [PATCH] mingw: add the build logic for the previous commit Separate commits for the zig logic and the copied files. --- src/mingw.zig | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/mingw.zig b/src/mingw.zig index 5a4e6b54cb..e114eb99ff 100644 --- a/src/mingw.zig +++ b/src/mingw.zig @@ -33,6 +33,9 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: *std.Progr try args.appendSlice(&[_][]const u8{ "-D_SYSCRT=1", "-DCRTDLL=1", + // Prevents warning: 'used' attribute ignored on a non-definition declaration + // pointing at extern _CRTALLOC + "-Wno-ignored-attributes", // Uncommenting this makes mingw-w64 look for wmain instead of main. //"-DUNICODE", //"-D_UNICODE", @@ -753,9 +756,9 @@ const mingwex_generic_src = [_][]const u8{ "stdio" ++ path.sep_str ++ "atoll.c", "stdio" ++ path.sep_str ++ "fgetpos64.c", "stdio" ++ path.sep_str ++ "fopen64.c", + "stdio" ++ path.sep_str ++ "fseeki64.c", "stdio" ++ path.sep_str ++ "fseeko32.c", "stdio" ++ path.sep_str ++ "fseeko64.c", - "stdio" ++ path.sep_str ++ "fseeki64.c", "stdio" ++ path.sep_str ++ "fsetpos64.c", "stdio" ++ path.sep_str ++ "ftello.c", "stdio" ++ path.sep_str ++ "ftello64.c", @@ -763,6 +766,36 @@ const mingwex_generic_src = [_][]const u8{ "stdio" ++ path.sep_str ++ "lltoa.c", "stdio" ++ path.sep_str ++ "lltow.c", "stdio" ++ path.sep_str ++ "lseek64.c", + "stdio" ++ path.sep_str ++ "mingw_asprintf.c", + "stdio" ++ path.sep_str ++ "mingw_dummy__lock.c", + "stdio" ++ path.sep_str ++ "mingw_fprintf.c", + "stdio" ++ path.sep_str ++ "mingw_fprintfw.c", + "stdio" ++ path.sep_str ++ "mingw_fscanf.c", + "stdio" ++ path.sep_str ++ "mingw_fwscanf.c", + "stdio" ++ path.sep_str ++ "mingw_lock.c", + "stdio" ++ path.sep_str ++ "mingw_pformat.c", + "stdio" ++ path.sep_str ++ "mingw_pformatw.c", + "stdio" ++ path.sep_str ++ "mingw_printf.c", + "stdio" ++ path.sep_str ++ "mingw_printfw.c", + "stdio" ++ path.sep_str ++ "mingw_scanf.c", + "stdio" ++ path.sep_str ++ "mingw_snprintf.c", + "stdio" ++ path.sep_str ++ "mingw_snprintfw.c", + "stdio" ++ path.sep_str ++ "mingw_sprintf.c", + "stdio" ++ path.sep_str ++ "mingw_sprintfw.c", + "stdio" ++ path.sep_str ++ "mingw_sscanf.c", + "stdio" ++ path.sep_str ++ "mingw_swscanf.c", + "stdio" ++ path.sep_str ++ "mingw_vasprintf.c", + "stdio" ++ path.sep_str ++ "mingw_vfprintf.c", + "stdio" ++ path.sep_str ++ "mingw_vfprintfw.c", + "stdio" ++ path.sep_str ++ "mingw_vfscanf.c", + "stdio" ++ path.sep_str ++ "mingw_vprintf.c", + "stdio" ++ path.sep_str ++ "mingw_vprintfw.c", + "stdio" ++ path.sep_str ++ "mingw_vsnprintf.c", + "stdio" ++ path.sep_str ++ "mingw_vsnprintfw.c", + "stdio" ++ path.sep_str ++ "mingw_vsprintf.c", + "stdio" ++ path.sep_str ++ "mingw_vsprintfw.c", + "stdio" ++ path.sep_str ++ "mingw_wscanf.c", + "stdio" ++ path.sep_str ++ "mingw_wvfscanf.c", "stdio" ++ path.sep_str ++ "scanf.S", "stdio" ++ path.sep_str ++ "snprintf.c", "stdio" ++ path.sep_str ++ "snwprintf.c",