From cc7879c7cd4e95a938a4243488b4aca578755816 Mon Sep 17 00:00:00 2001 From: Tomoya Tanjo Date: Fri, 11 Aug 2017 22:20:15 +0900 Subject: [PATCH] Enclose WinMain with unittest else block --- src/dlangui/platforms/common/platform.d | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/dlangui/platforms/common/platform.d b/src/dlangui/platforms/common/platform.d index 1feffaac..a78ac84d 100644 --- a/src/dlangui/platforms/common/platform.d +++ b/src/dlangui/platforms/common/platform.d @@ -1896,16 +1896,19 @@ mixin template APP_ENTRY_POINT() { } 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) - { - try { - int res = DLANGUIWinMain(hInstance, hPrevInstance, - lpCmdLine, nCmdShow); - return res; - } catch (Exception e) { - Log.e("Exception: ", e); - return 1; + version (unittest) { + } else { + extern (Windows) int WinMain(void* hInstance, void* hPrevInstance, + char* lpCmdLine, int nCmdShow) + { + try { + int res = DLANGUIWinMain(hInstance, hPrevInstance, + lpCmdLine, nCmdShow); + return res; + } catch (Exception e) { + Log.e("Exception: ", e); + return 1; + } } } } else {