Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 57 lines (50 sloc) 1.788 kb
9595725 update copyrights to 2011
Laurent Sansonetti authored
1 /*
2 * This file is covered by the Ruby license. See COPYING for more details.
7d7d3e8 @ferrous26 Change ownership to The MacRuby Team and update copyrights
ferrous26 authored
3 *
4 * Copyright (C) 2012, The MacRuby Team. All rights reserved.
9595725 update copyrights to 2011
Laurent Sansonetti authored
5 * Copyright (C) 2007-2011, Apple Inc. All rights reserved.
6 * Copyright (C) 1993-2007 Yukihiro Matsumoto
7 */
511dc44 initial import
Laurent Sansonetti authored
8
d0898dd include/ruby/macruby.h -> macruby_internal.h
Laurent Sansonetti authored
9 #include "macruby_internal.h"
511dc44 initial import
Laurent Sansonetti authored
10 #include "version.h"
30a73ad fix for #173 (patch contributed by Vincent Isambart)
Laurent Sansonetti authored
11 #include "revision.h"
511dc44 initial import
Laurent Sansonetti authored
12 #include <stdio.h>
13
14 #define PRINT(type) puts(ruby_##type)
eee9d7b sync with ruby trunk r15665
Laurent Sansonetti authored
15 #define MKSTR(type) rb_obj_freeze(rb_usascii_str_new(ruby_##type, sizeof(ruby_##type)-1))
511dc44 initial import
Laurent Sansonetti authored
16
17 const int ruby_version_code = RUBY_VERSION_CODE;
18 const char ruby_version[] = RUBY_VERSION;
19 const char ruby_release_date[] = RUBY_RELEASE_DATE;
20 const char ruby_platform[] = RUBY_PLATFORM;
21 const int ruby_patchlevel = RUBY_PATCHLEVEL;
22 const char ruby_description[] = RUBY_DESCRIPTION;
23 const char ruby_copyright[] = RUBY_COPYRIGHT;
4a2b903 merging lrz_unstable branch
Laurent Sansonetti authored
24 const char ruby_engine[] = RUBY_ENGINE;
511dc44 initial import
Laurent Sansonetti authored
25
26 void
27 Init_version(void)
28 {
29 rb_define_global_const("RUBY_VERSION", MKSTR(version));
30 rb_define_global_const("RUBY_RELEASE_DATE", MKSTR(release_date));
31 rb_define_global_const("RUBY_PLATFORM", MKSTR(platform));
32 rb_define_global_const("RUBY_PATCHLEVEL", INT2FIX(RUBY_PATCHLEVEL));
33 rb_define_global_const("RUBY_REVISION", INT2FIX(RUBY_REVISION));
34 rb_define_global_const("RUBY_DESCRIPTION", MKSTR(description));
35 rb_define_global_const("RUBY_COPYRIGHT", MKSTR(copyright));
4a2b903 merging lrz_unstable branch
Laurent Sansonetti authored
36 rb_define_global_const("RUBY_ENGINE", MKSTR(engine));
26d8594 framework/universal build work, still in progress
Laurent Sansonetti authored
37 #if WITH_OBJC
6bcd45f merging macruby64 branch into trunk
Laurent Sansonetti authored
38 rb_define_global_const("RUBY_ARCH", rb_str_new2(RUBY_ARCH));
941c1e4 MACRUBY_VERSION is now a string
Laurent Sansonetti authored
39 rb_define_global_const("MACRUBY_VERSION", rb_str_new2(MACRUBY_VERSION));
30a73ad fix for #173 (patch contributed by Vincent Isambart)
Laurent Sansonetti authored
40 rb_define_global_const("MACRUBY_REVISION", rb_str_new2(MACRUBY_REVISION));
26d8594 framework/universal build work, still in progress
Laurent Sansonetti authored
41 #endif
511dc44 initial import
Laurent Sansonetti authored
42 }
43
44 void
45 ruby_show_version(void)
46 {
47 PRINT(description);
48 fflush(stdout);
49 }
50
51 void
52 ruby_show_copyright(void)
53 {
54 PRINT(copyright);
55 exit(0);
56 }
Something went wrong with that request. Please try again.