mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f32c76a266
commit
6689997b5e
4 changed files with 26 additions and 19 deletions
3
eval.c
3
eval.c
|
@ -8110,6 +8110,9 @@ rb_cont_call(argc, argv, cont)
|
||||||
{
|
{
|
||||||
rb_thread_t th = rb_thread_check(cont);
|
rb_thread_t th = rb_thread_check(cont);
|
||||||
|
|
||||||
|
if (th->next != curr_thread) {
|
||||||
|
rb_raise(rb_eRuntimeError, "continuation called across threads");
|
||||||
|
}
|
||||||
switch (argc) {
|
switch (argc) {
|
||||||
case 0:
|
case 0:
|
||||||
th->result = Qnil;
|
th->result = Qnil;
|
||||||
|
|
2
intern.h
2
intern.h
|
@ -281,6 +281,8 @@ void ruby_prog_init _((void));
|
||||||
void ruby_set_argv _((int, char**));
|
void ruby_set_argv _((int, char**));
|
||||||
void ruby_process_options _((int, char**));
|
void ruby_process_options _((int, char**));
|
||||||
void ruby_load_script _((void));
|
void ruby_load_script _((void));
|
||||||
|
void ruby_init_loadpath _((void));
|
||||||
|
void ruby_incpush _((const char*));
|
||||||
/* signal.c */
|
/* signal.c */
|
||||||
VALUE rb_f_kill _((int, VALUE*));
|
VALUE rb_f_kill _((int, VALUE*));
|
||||||
void rb_gc_mark_trap_list _((void));
|
void rb_gc_mark_trap_list _((void));
|
||||||
|
|
37
ruby.c
37
ruby.c
|
@ -166,8 +166,8 @@ rubylib_mangle(s, l)
|
||||||
#define rubylib_mangled_path2(s) rb_str_new2(s)
|
#define rubylib_mangled_path2(s) rb_str_new2(s)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
void
|
||||||
incpush(path)
|
ruby_incpush(path)
|
||||||
const char *path;
|
const char *path;
|
||||||
{
|
{
|
||||||
const char sep = PATH_SEP_CHAR;
|
const char sep = PATH_SEP_CHAR;
|
||||||
|
@ -203,36 +203,36 @@ incpush(path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
ruby_path_init()
|
ruby_init_loadpath()
|
||||||
{
|
{
|
||||||
if (rb_safe_level() == 0) {
|
if (rb_safe_level() == 0) {
|
||||||
incpush(getenv("RUBYLIB"));
|
ruby_incpush(getenv("RUBYLIB"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef RUBY_SEARCH_PATH
|
#ifdef RUBY_SEARCH_PATH
|
||||||
incpush(RUBY_SEARCH_PATH);
|
ruby_incpush(RUBY_SEARCH_PATH);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RUBY_SITE_THIN_ARCHLIB
|
#ifdef RUBY_SITE_THIN_ARCHLIB
|
||||||
incpush(RUBY_SITE_THIN_ARCHLIB);
|
ruby_incpush(RUBY_SITE_THIN_ARCHLIB);
|
||||||
#endif
|
#endif
|
||||||
incpush(RUBY_SITE_ARCHLIB);
|
ruby_incpush(RUBY_SITE_ARCHLIB);
|
||||||
incpush(RUBY_SITE_LIB2);
|
ruby_incpush(RUBY_SITE_LIB2);
|
||||||
incpush(RUBY_SITE_LIB);
|
ruby_incpush(RUBY_SITE_LIB);
|
||||||
|
|
||||||
#ifdef RUBY_THIN_ARCHLIB
|
#ifdef RUBY_THIN_ARCHLIB
|
||||||
incpush(RUBY_THIN_ARCHLIB);
|
ruby_incpush(RUBY_THIN_ARCHLIB);
|
||||||
#endif
|
#endif
|
||||||
incpush(RUBY_ARCHLIB);
|
ruby_incpush(RUBY_ARCHLIB);
|
||||||
|
|
||||||
incpush(RUBY_LIB);
|
ruby_incpush(RUBY_LIB);
|
||||||
#if defined(_WIN32) || defined(DJGPP)
|
#if defined(_WIN32) || defined(DJGPP)
|
||||||
incpush(ruby_libpath());
|
ruby_incpush(ruby_libpath());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (rb_safe_level() == 0) {
|
if (rb_safe_level() == 0) {
|
||||||
incpush(".");
|
ruby_incpush(".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,7 +360,6 @@ proc_options(argc, argv)
|
||||||
|
|
||||||
if (argc == 0) return;
|
if (argc == 0) return;
|
||||||
|
|
||||||
version = Qfalse;
|
|
||||||
do_search = Qfalse;
|
do_search = Qfalse;
|
||||||
|
|
||||||
for (argc--,argv++; argc > 0; argc--,argv++) {
|
for (argc--,argv++; argc > 0; argc--,argv++) {
|
||||||
|
@ -515,9 +514,9 @@ proc_options(argc, argv)
|
||||||
case 'I':
|
case 'I':
|
||||||
forbid_setid("-I");
|
forbid_setid("-I");
|
||||||
if (*++s)
|
if (*++s)
|
||||||
incpush(s);
|
ruby_incpush(s);
|
||||||
else if (argv[1]) {
|
else if (argv[1]) {
|
||||||
incpush(argv[1]);
|
ruby_incpush(argv[1]);
|
||||||
argc--,argv++;
|
argc--,argv++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -659,7 +658,7 @@ proc_options(argc, argv)
|
||||||
ruby_set_argv(argc, argv);
|
ruby_set_argv(argc, argv);
|
||||||
process_sflag();
|
process_sflag();
|
||||||
|
|
||||||
ruby_path_init();
|
ruby_init_loadpath();
|
||||||
ruby_sourcefile = argv0;
|
ruby_sourcefile = argv0;
|
||||||
if (e_script) {
|
if (e_script) {
|
||||||
require_libraries();
|
require_libraries();
|
||||||
|
|
|
@ -503,6 +503,9 @@ EXPORTS
|
||||||
ruby_prog_init
|
ruby_prog_init
|
||||||
ruby_set_argv
|
ruby_set_argv
|
||||||
ruby_process_options
|
ruby_process_options
|
||||||
|
ruby_load_script
|
||||||
|
ruby_init_loadpath
|
||||||
|
ruby_incpush
|
||||||
;signal.c
|
;signal.c
|
||||||
rb_f_kill
|
rb_f_kill
|
||||||
rb_gc_mark_trap_list
|
rb_gc_mark_trap_list
|
||||||
|
|
Loading…
Reference in a new issue