mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Make Windows use wWinMain always. Support /SUBSYSTEM:WINDOWS
This commit is contained in:
committed by
Christoffer Lerno
parent
5ea15eb708
commit
52d7e58c19
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -188,7 +188,7 @@ jobs:
|
||||
- name: Install Clang ${{matrix.llvm_version}}
|
||||
run: |
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
if [[ "${{matrix.llvm_version}}" < 16 ]]; then
|
||||
if [[ "${{matrix.llvm_version}}" < 17 ]]; then
|
||||
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${{matrix.llvm_version}} main"
|
||||
else
|
||||
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main"
|
||||
|
||||
@@ -2014,6 +2014,7 @@ NEXT:;
|
||||
|
||||
static inline Decl *sema_create_synthetic_wmain(SemaContext *context, Decl *decl, MainType main, bool int_return, bool err_return)
|
||||
{
|
||||
if (main == MAIN_TYPE_NO_ARGS) return sema_create_synthetic_main(context, decl, main, int_return, err_return);
|
||||
Decl *function = decl_new(DECL_FUNC, NULL, decl->span, VISIBLE_EXTERN);
|
||||
function->name = kw_mainstub;
|
||||
function->unit = decl->unit;
|
||||
@@ -2042,14 +2043,6 @@ static inline Decl *sema_create_synthetic_wmain(SemaContext *context, Decl *decl
|
||||
case 2 : main_invoker = "@wmain_to_err_main_args"; goto NEXT;
|
||||
default: UNREACHABLE
|
||||
}
|
||||
case MAIN_TYPE_NO_ARGS:
|
||||
switch (type)
|
||||
{
|
||||
case 0 : main_invoker = "@main_to_void_main"; goto NEXT;
|
||||
case 1 : main_invoker = "@main_to_int_main"; goto NEXT;
|
||||
case 2 : main_invoker = "@main_to_err_main"; goto NEXT;
|
||||
default: UNREACHABLE
|
||||
}
|
||||
default:
|
||||
UNREACHABLE;
|
||||
}
|
||||
@@ -2216,6 +2209,7 @@ static inline bool sema_analyse_main_function(SemaContext *context, Decl *decl)
|
||||
}
|
||||
if (platform_target.os == OS_TYPE_WIN32)
|
||||
{
|
||||
|
||||
function = active_target.gui
|
||||
? sema_create_synthetic_win_main(context, decl, type, is_int_return, is_err_return)
|
||||
: sema_create_synthetic_wmain(context, decl, type, is_int_return, is_err_return);
|
||||
|
||||
Reference in New Issue
Block a user