mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Win32: Expose wchar main routine only
Warned if both of `main` and `wmain` are exposed: ``` LINK : warning LNK4067: ambiguous entry point; selected 'mainCRTStartup' ```
This commit is contained in:
parent
b92a9905ae
commit
bd95287a0f
2 changed files with 8 additions and 6 deletions
10
main.c
10
main.c
|
@ -30,6 +30,12 @@
|
|||
# undef RUBY_DEBUG_ENV
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define main(argc, argv) w32_main(argc, argv)
|
||||
static int main(int argc, char **argv);
|
||||
int wmain(void) {return main(0, NULL);}
|
||||
#endif
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
|
@ -47,7 +53,3 @@ main(int argc, char **argv)
|
|||
return ruby_run_node(ruby_options(argc, argv));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
int wmain(void) {return main(0, NULL);}
|
||||
#endif
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern int main(int, char**);
|
||||
extern int wmain(int, WCHAR**);
|
||||
|
||||
int WINAPI
|
||||
WinMain(HINSTANCE current, HINSTANCE prev, LPSTR cmdline, int showcmd)
|
||||
{
|
||||
return main(0, NULL);
|
||||
return wmain(0, NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue