Skip to content

Commit

Permalink
support Windows gui apps
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Oct 12, 2012
1 parent c755b3a commit 4b899f4
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/glue.c
Expand Up @@ -662,6 +662,7 @@ void FuncDeclaration::toObjFile(int multiobj)
{
objmod->includelib("LIBCMT");
objmod->includelib("OLDNAMES");
objmod->ehsections(); // initialize exception handling sections
}
else
{
Expand All @@ -674,15 +675,35 @@ void FuncDeclaration::toObjFile(int multiobj)
#if TARGET_WINDOS
else if (func->isWinMain() && onlyOneMain(loc))
{
objmod->external_def("__acrtused");
if (I64)
{
objmod->includelib("uuid");
objmod->includelib("LIBCMT");
objmod->includelib("OLDNAMES");
objmod->ehsections(); // initialize exception handling sections
}
else
{
objmod->external_def("__acrtused");
}
objmod->includelib(libname);
s->Sclass = SCglobal;
}

// Pull in RTL startup code
else if (func->isDllMain() && onlyOneMain(loc))
{
objmod->external_def("__acrtused_dll");
if (I64)
{
objmod->includelib("uuid");
objmod->includelib("LIBCMT");
objmod->includelib("OLDNAMES");
objmod->ehsections(); // initialize exception handling sections
}
else
{
objmod->external_def("__acrtused_dll");
}
objmod->includelib(libname);
s->Sclass = SCglobal;
}
Expand Down

0 comments on commit 4b899f4

Please sign in to comment.