MRI: Fix mingw build crash when linking with -mwindows
This commit is contained in:
		
							parent
							
								
									9ac14800da
								
							
						
					
					
						commit
						33c571e691
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
					@ -540,6 +540,13 @@ static void showExc(VALUE exc, const BacktraceData &btData)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void mriBindingExecute()
 | 
					static void mriBindingExecute()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						/* Normally only a ruby executable would do a sysinit,
 | 
				
			||||||
 | 
						 * but not doing it will lead to crashes due to closed
 | 
				
			||||||
 | 
						 * stdio streams on some platforms (eg. Windows) */
 | 
				
			||||||
 | 
						int argc = 0;
 | 
				
			||||||
 | 
						char **argv = 0;
 | 
				
			||||||
 | 
						ruby_sysinit(&argc, &argv);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ruby_setup();
 | 
						ruby_setup();
 | 
				
			||||||
	rb_enc_set_default_external(rb_enc_from_encoding(rb_utf8_encoding()));
 | 
						rb_enc_set_default_external(rb_enc_from_encoding(rb_utf8_encoding()));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue