Skip to content

Commit b3a1fc1

Browse files
nobuhsbt
authored andcommitted
Use wide character startup
Mingw crt-git 12.0.0.r369.g0d4221712-1 now prohibits "command line contains characters that are not supported in the active code page". https://sourceforge.net/p/mingw-w64/mingw-w64/ci/0d42217123d3aec0341b79f6d959c76e09648a1e/ Already Ruby builds `argv` in `rb_w32_sysinit`, instead of mswin- or mingw-made `argv`. Just bypass the conversion in mingw crt.
1 parent 792826d commit b3a1fc1

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

cygwin/GNUmakefile.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ gnumake = yes
22

33
include Makefile
44

5+
override EXE_LDFLAGS += -municode
6+
57
DLLWRAP = @DLLWRAP@ --target=$(target_os) --driver-name="$(CC)"
68
ifeq (@USE_LLVM_WINDRES@,yes) # USE_LLVM_WINDRES
79
# llvm-windres fails when preprocessor options are added
@@ -69,7 +71,7 @@ $(PROGRAM): $(RUBY_INSTALL_NAME).res.$(OBJEXT)
6971
$(WPROGRAM): $(RUBYW_INSTALL_NAME).res.$(OBJEXT)
7072
@rm -f $@
7173
$(ECHO) linking $@
72-
$(Q) $(PURIFY) $(CC) -mwindows -e $(SYMBOL_PREFIX)mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \
74+
$(Q) $(PURIFY) $(CC) -municode -mwindows -e $(SYMBOL_PREFIX)mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \
7375
$(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
7476
$(STUBPROGRAM): $(RUBY_INSTALL_NAME).res.$(OBJEXT)
7577

main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,7 @@ main(int argc, char **argv)
5757
ruby_sysinit(&argc, &argv);
5858
return rb_main(argc, argv);
5959
}
60+
61+
#ifdef _WIN32
62+
int wmain(void) {return main(0, NULL);}
63+
#endif

0 commit comments

Comments
 (0)