~ubuntu-branches/ubuntu/intrepid/ruby1.9/intrepid-updates

« back to all changes in this revision

Viewing changes to debian/generated-incs/prelude.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-09-04 16:01:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070904160117-i15zckg2nhxe9fyw
Tags: 1.9.0+20070830-2ubuntu1
* Sync from Debian; remaining changes:
  - Add -g to CFLAGS.
* Fixes build failure on ia64.
* Fixes build failure with gcc-4.2 on lpia.
* Robustify check for target_os, fixing build failure on lpia.
* Set Ubuntu maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#include "ruby/ruby.h"
 
3
#include "vm_core.h"
 
4
 
 
5
static const char prelude_name[] = "prelude.rb";
 
6
static const char prelude_code[] =
 
7
"\n"
 
8
"# Mutex\n"
 
9
"\n"
 
10
"class Mutex\n"
 
11
"  def synchronize\n"
 
12
"    self.lock\n"
 
13
"    begin\n"
 
14
"      yield\n"
 
15
"    ensure\n"
 
16
"      self.unlock\n"
 
17
"    end\n"
 
18
"  end\n"
 
19
"end\n"
 
20
"\n"
 
21
"# Thread\n"
 
22
"\n"
 
23
"class Thread\n"
 
24
"  MUTEX_FOR_THREAD_EXCLUSIVE = Mutex.new\n"
 
25
"  def self.exclusive\n"
 
26
"    MUTEX_FOR_THREAD_EXCLUSIVE.synchronize{\n"
 
27
"      yield\n"
 
28
"    }\n"
 
29
"  end\n"
 
30
"end\n"
 
31
"\n"
 
32
;
 
33
 
 
34
void
 
35
Init_prelude(void)
 
36
{
 
37
  rb_iseq_eval(rb_iseq_compile(
 
38
    rb_str_new(prelude_code, sizeof(prelude_code) - 1),
 
39
    rb_str_new(prelude_name, sizeof(prelude_name) - 1),
 
40
    INT2FIX(1)));
 
41
 
 
42
#if 0
 
43
    printf("%s\n", prelude_code);
 
44
#endif
 
45
}