mirror of https://github.com/buggins/dlangui.git
no main in unit tests - buggins/dlangide#276
This commit is contained in:
parent
e2116d0be9
commit
54356dbca1
src/dlangui/platforms/common
|
@ -1940,35 +1940,31 @@ static if (BACKEND_CONSOLE) {
|
||||||
|
|
||||||
/// put "mixin APP_ENTRY_POINT;" to main module of your dlangui based app
|
/// put "mixin APP_ENTRY_POINT;" to main module of your dlangui based app
|
||||||
mixin template APP_ENTRY_POINT() {
|
mixin template APP_ENTRY_POINT() {
|
||||||
static if (BACKEND_CONSOLE) {
|
version (unittest) {
|
||||||
int main(string[] args)
|
// no main in unit tests
|
||||||
{
|
|
||||||
return DLANGUImain(args);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
/// workaround for link issue when WinMain is located in library
|
static if (BACKEND_CONSOLE) {
|
||||||
version(Windows) {
|
int main(string[] args)
|
||||||
version (unittest) {
|
{
|
||||||
// no main in unit tests
|
return DLANGUImain(args);
|
||||||
} else {
|
}
|
||||||
|
} else {
|
||||||
|
/// workaround for link issue when WinMain is located in library
|
||||||
|
version(Windows) {
|
||||||
extern (Windows) int WinMain(void* hInstance, void* hPrevInstance,
|
extern (Windows) int WinMain(void* hInstance, void* hPrevInstance,
|
||||||
char* lpCmdLine, int nCmdShow)
|
char* lpCmdLine, int nCmdShow)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
int res = DLANGUIWinMain(hInstance, hPrevInstance,
|
int res = DLANGUIWinMain(hInstance, hPrevInstance,
|
||||||
lpCmdLine, nCmdShow);
|
lpCmdLine, nCmdShow);
|
||||||
return res;
|
return res;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("Exception: ", e);
|
Log.e("Exception: ", e);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
|
||||||
version (Android) {
|
|
||||||
} else {
|
} else {
|
||||||
version (unittest) {
|
version (Android) {
|
||||||
// no main in unit tests
|
|
||||||
} else {
|
} else {
|
||||||
int main(string[] args)
|
int main(string[] args)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue