Enclose WinMain with unittest else block

This commit is contained in:
Tomoya Tanjo 2017-08-11 22:20:15 +09:00
parent f735e5cea8
commit cc7879c7cd
1 changed files with 13 additions and 10 deletions

View File

@ -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 {