mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	 f610abc0a6
			
		
	
	
		f610abc0a6
		
	
	
	
	
		
			
			* goruby.c (goruby_run_node): run after ruby_init_loadpath() so that require works, and protect the call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
		
			
				
	
	
		
			24 lines
		
	
	
	
		
			499 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			499 B
		
	
	
	
		
			C
		
	
	
	
	
	
| void Init_golf(void); 
 | |
| #define ruby_run_node goruby_run_node
 | |
| #include "main.c"
 | |
| #undef ruby_run_node
 | |
| 
 | |
| RUBY_EXTERN int ruby_run_node(void*);
 | |
| RUBY_EXTERN void ruby_init_ext(const char *name, void (*init)(void));
 | |
| 
 | |
| static VALUE
 | |
| init_golf(VALUE arg)
 | |
| {
 | |
|     ruby_init_ext("golf", Init_golf);
 | |
|     return arg;
 | |
| }
 | |
| 
 | |
| int
 | |
| goruby_run_node(void *arg)
 | |
| {
 | |
|     int state;
 | |
|     if (NIL_P(rb_protect(init_golf, Qtrue, &state))) {
 | |
| 	return state == EXIT_SUCCESS ? EXIT_FAILURE : state;
 | |
|     }
 | |
|     return ruby_run_node(arg);
 | |
| }
 |