Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 41 lines (37 sloc) 0.803 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
/*
* This file is covered by the Ruby license. See COPYING for more details.
*
* Copyright (C) 2007-2008, Apple Inc. All rights reserved.
* Copyright (C) 1993-2007 Yukihiro Matsumoto
*/

#undef RUBY_EXPORT
#include "ruby.h"
#include "ruby/node.h"
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif

extern "C" void rb_vm_print_current_exception(void);
extern "C" void rb_vm_aot_compile(NODE *);

int
main(int argc, char **argv, char **envp)
{
#ifdef HAVE_LOCALE_H
    setlocale(LC_CTYPE, "");
#endif

    try {
ruby_sysinit(&argc, &argv);
ruby_init();
void *node = ruby_options(argc, argv);
if (ruby_aot_compile) {
rb_vm_aot_compile((NODE *)node);
rb_exit(0);
}
else {
rb_exit(ruby_run_node(node));
}
    }
    catch (...) {
rb_vm_print_current_exception();
exit(1);
    }
}
Something went wrong with that request. Please try again.