Main.cpp for static linking in legacy
Similar to non-legacy static linking
This commit is contained in:
39
legacy/templates/cpp/static/Main.cpp
Normal file
39
legacy/templates/cpp/static/Main.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HX_WINDOWS
|
||||
#include <windows.h>
|
||||
#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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user