Skip to content
This repository was archived by the owner on Nov 20, 2020. It is now read-only.

Commit bb79cdc

Browse files
committedMar 3, 2013
Added winmain entry for wlua target
1 parent 2c25e2a commit bb79cdc

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed
 

‎CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ target_link_libraries ( lua liblua )
147147

148148
# On windows a variant of the lua interpreter without console output needs to be built
149149
if ( LUA_BUILD_WLUA )
150-
add_executable ( wlua WIN32 ${SRC_LUA} ${LUA_RC} )
150+
add_executable ( wlua WIN32 src/wmain.c ${SRC_LUA} ${LUA_RC} )
151151
target_link_libraries ( wlua liblua )
152152
install_executable ( wlua )
153153
endif ( )

‎src/wmain.c

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <windows.h>
2+
#include <stdlib.h> /* declaration of __argc and __argv */
3+
4+
extern int main(int, char **);
5+
6+
int PASCAL WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int ncmdshow)
7+
{
8+
int rc;
9+
10+
extern int __argc; /* this seems to work for all the compilers we tested, except Watcom compilers */
11+
extern char** __argv;
12+
13+
rc = main(__argc, __argv);
14+
15+
return rc;
16+
}

0 commit comments

Comments
 (0)
This repository has been archived.