From e555335bf07f483b29ecb9b147b40f42dc2c4bbf Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 14 Apr 2022 13:28:46 +0300 Subject: [PATCH] ci: fix windows-msvc builds, as well as the windows-cross job, turn on deprecation notices for [windows_stdcall] and [_fastcall] --- .github/workflows/ci_cross.yml | 8 +++----- vlib/builtin/builtin_windows.c.v | 2 +- vlib/v/parser/fn.v | 8 ++++---- vlib/v/tests/create_dll/create_win_dll.v | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci_cross.yml b/.github/workflows/ci_cross.yml index be07e9255d..8512c4b8fd 100644 --- a/.github/workflows/ci_cross.yml +++ b/.github/workflows/ci_cross.yml @@ -77,7 +77,7 @@ jobs: - name: v_win.c can be compiled and run with -os windows run: | - ./v -os windows -o /tmp/v_win.c cmd/v + ./v -cc msvc -os windows -o /tmp/v_win.c cmd/v x86_64-w64-mingw32-gcc -I ./thirdparty/stdatomic/win /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe ls -lart v_from_vc.exe wine64 ./v_from_vc.exe version @@ -102,8 +102,6 @@ jobs: windows-cross: runs-on: windows-2019 timeout-minutes: 25 - env: - VFLAGS: -cc msvc steps: - uses: actions/checkout@v2 - name: Build @@ -113,8 +111,8 @@ jobs: .\make.bat -msvc - name: TODO v_win.c can be compiled and run with -os windows run: | - .\v.exe -os windows -showcc -o v2.exe cmd\v - .\v.exe -os windows -o v_win.c cmd\v + .\v.exe -os windows -cc msvc -showcc -o v2.exe cmd\v + .\v.exe -os windows -cc msvc -o v_win.c cmd\v dir v2.exe dir v_win.c .\v2.exe version diff --git a/vlib/builtin/builtin_windows.c.v b/vlib/builtin/builtin_windows.c.v index a7054832f5..aba7b6ced0 100644 --- a/vlib/builtin/builtin_windows.c.v +++ b/vlib/builtin/builtin_windows.c.v @@ -238,7 +238,7 @@ fn add_vectored_exception_handler(handler VectoredExceptionHandler) { C.AddVectoredExceptionHandler(1, C.PVECTORED_EXCEPTION_HANDLER(handler)) } -[windows_stdcall] +[callconv: stdcall] fn unhandled_exception_handler(e &ExceptionPointers) int { match e.exception_record.code { // These are 'used' by the backtrace printer diff --git a/vlib/v/parser/fn.v b/vlib/v/parser/fn.v index 4cff8699f6..3ab9f457b0 100644 --- a/vlib/v/parser/fn.v +++ b/vlib/v/parser/fn.v @@ -222,12 +222,12 @@ fn (mut p Parser) fn_decl() ast.FnDecl { is_markused = true } 'windows_stdcall' { - // TODO: uncomment after bootstrapping and replacing usages in builtin - // p.note_with_pos('windows_stdcall has been deprecated, it will be an error soon', p.tok.pos()) + p.note_with_pos('the tag [windows_stdcall] has been deprecated, it will be an error after 2022-06-01, use `[callconv: stdcall]` instead', + p.tok.pos()) } '_fastcall' { - // TODO: uncomment after bootstrapping and replacing usages in builtin - // p.note_with_pos('_fastcall has been deprecated, it will be an error soon', p.tok.pos()) + p.note_with_pos('teh tag [_fastcall] has been deprecated, it will be an error after 2022-06-01, use `[callconv: fastcall]` instead', + p.tok.pos()) } 'callconv' { if !fna.has_arg { diff --git a/vlib/v/tests/create_dll/create_win_dll.v b/vlib/v/tests/create_dll/create_win_dll.v index 02ef5d68e1..c8a966aa46 100644 --- a/vlib/v/tests/create_dll/create_win_dll.v +++ b/vlib/v/tests/create_dll/create_win_dll.v @@ -14,7 +14,7 @@ pub fn test_tatltuae() int { } [export: DllMain] -[windows_stdcall] +[callconv: stdcall] fn main(hinst voidptr, fdw_reason int, lp_reserved voidptr) bool { match fdw_reason { C.DLL_PROCESS_ATTACH {