diff --git a/legacy/templates/cpp/static/Main.cpp b/legacy/templates/cpp/static/Main.cpp new file mode 100644 index 000000000..deb0932e3 --- /dev/null +++ b/legacy/templates/cpp/static/Main.cpp @@ -0,0 +1,39 @@ +#include + +#ifdef HX_WINDOWS +#include +#endif + +extern "C" const char *hxRunLibrary (); +extern "C" void hxcpp_set_top_of_stack (); + +extern "C" int lime_legacy_register_prims(); +::foreach ndlls::::if (registerStatics):: +extern "C" int ::nameSafe::_register_prims ();::end::::end:: + + +#ifdef HX_WINDOWS +int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { +#else +extern "C" int main(int argc, char *argv[]) { +#endif + + hxcpp_set_top_of_stack (); + + lime_legacy_register_prims(); + ::foreach ndlls::::if (registerStatics):: + ::nameSafe::_register_prims ();::end::::end:: + + const char *err = NULL; + err = hxRunLibrary (); + + if (err) { + + printf("Error: %s\n", err); + return -1; + + } + + return 0; + +}