Skip to content

Commit

Permalink
fix issue dlang#272: Main function parameters must match one of the s…
Browse files Browse the repository at this point in the history
…ignatures

rename main to win_main in WindowsApp template
  • Loading branch information
rainers committed Apr 13, 2024
1 parent 733312b commit abbba3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions visuald/Templates/ProjectItems/VDProject/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ extern (C) int _d_run_main(int argc, char **argv, MainFunc mainFunc);
extern (Windows)
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
return _d_run_main(0, null, &main); // arguments unused, retrieved via CommandLineToArgvW
return _d_run_main(0, null, &win_main); // arguments unused, retrieved via CommandLineToArgvW
}

extern(C) int main(string[] args)
extern(C) int win_main(string[] args)
{
MessageBoxW(null, "Hello D World!"w.ptr, "D Windows Application"w.ptr, MB_OK);
return 0;
Expand Down Expand Up @@ -39,4 +39,4 @@ int foo()
{
return 42;
}
$endif$
$endif$

0 comments on commit abbba3f

Please sign in to comment.