diff --git a/src/dlangui/platforms/common/platform.d b/src/dlangui/platforms/common/platform.d index cc2df969..b8ce7356 100644 --- a/src/dlangui/platforms/common/platform.d +++ b/src/dlangui/platforms/common/platform.d @@ -1940,35 +1940,31 @@ static if (BACKEND_CONSOLE) { /// put "mixin APP_ENTRY_POINT;" to main module of your dlangui based app mixin template APP_ENTRY_POINT() { - static if (BACKEND_CONSOLE) { - int main(string[] args) - { - return DLANGUImain(args); - } + version (unittest) { + // no main in unit tests } else { - /// workaround for link issue when WinMain is located in library - version(Windows) { - version (unittest) { - // no main in unit tests - } else { + static if (BACKEND_CONSOLE) { + int main(string[] args) + { + return DLANGUImain(args); + } + } else { + /// workaround for link issue when WinMain is located in library + version(Windows) { extern (Windows) int WinMain(void* hInstance, void* hPrevInstance, - char* lpCmdLine, int nCmdShow) + char* lpCmdLine, int nCmdShow) { try { int res = DLANGUIWinMain(hInstance, hPrevInstance, - lpCmdLine, nCmdShow); + lpCmdLine, nCmdShow); return res; } catch (Exception e) { Log.e("Exception: ", e); return 1; } } - } - } else { - version (Android) { } else { - version (unittest) { - // no main in unit tests + version (Android) { } else { int main(string[] args) {