Fix Main.cpp template for -static -debug builds

When building a Lime application in debug mode on Windows, the console
subsystem is used and Windows looks for a 'main' function. However, the
Main.cpp file used when linking statically always defines a 'WinMain'
function regardless of whether the application is being built in debug
mode.

This commit adds an additional check in the Main.cpp that defines a
'main' function instead of 'WinMain' when building in debug mode.
This commit is contained in:
arm32x
2022-05-04 13:10:13 -04:00
parent c406bc53ea
commit 3c4ddbab17

View File

@@ -1,6 +1,6 @@
#include <stdio.h>
#ifdef HX_WINDOWS
#if defined(HX_WINDOWS) && !defined(HXCPP_DEBUG)
#include <windows.h>
#endif
@@ -14,7 +14,7 @@ extern "C" int lime_openal_register_prims ();
extern "C" int ::nameSafe::_register_prims ();::end::::end::
#ifdef HX_WINDOWS
#if defined(HX_WINDOWS) && !defined(HXCPP_DEBUG)
int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
#else
extern "C" int main(int argc, char *argv[]) {
@@ -40,4 +40,4 @@ extern "C" int main(int argc, char *argv[]) {
return 0;
}
}