# Patch to compile under ruby 1.9 (svn)

**URL:** <https://www.ruby-forum.com/t/patch-to-compile-under-ruby-1-9-svn/151837>\
**Category:** Ruby-Gnome 2\
**Created:** [October 26, 2008, 6:38pm UTC](https://www.ruby-forum.com/t/patch-to-compile-under-ruby-1-9-svn/151837 "2008-10-26T18:38:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [October 26, 2008, 6:38pm UTC](https://www.ruby-forum.com/t/patch-to-compile-under-ruby-1-9-svn/151837/1 "2008-10-26T18:38:14Z")

</div>

Below you can find the patch to current svn that needs to be applied  
to compile under ruby 1.9 (current svn).

The only stuff that needed to be changed (but many, many times…) is  
from

RARRAY(xxx)-\>len  
to  
RARRAY\_LEN(xxx)

and from

RARRAY(xxx)-\>ptr  
to  
RARRAY\_PTR(xxx)

The whole tree compiles, but I only use GTK (and a relatively small  
part of it). Thus, no warranty…

Carlo

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 9, 2008, 12:29pm UTC](https://www.ruby-forum.com/t/patch-to-compile-under-ruby-1-9-svn/151837/2 "2008-12-09T12:29:07Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] Patch to compile under ruby 1.9 (svn)” on Sun,  
26 Oct 2008 17:57:23 +0100,  
“Carlo E. Prelz” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> and from
> 
> RARRAY(xxx)-\>ptr  
> to  
> RARRAY\_PTR(xxx)
> 
> The whole tree compiles, but I only use GTK (and a relatively small  
> part of it). Thus, no warranty…

I’m sorry for my late response. I did the same work a month ago.  
I know that there are many other problems to work with Ruby  
1.9 but I have time for now…

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 10, 2008, 10:58am UTC](https://www.ruby-forum.com/t/patch-to-compile-under-ruby-1-9-svn/151837/3 "2008-12-10T10:58:29Z")

</div>

Subject: Re: [ruby-gnome2-devel-en] Patch to compile under ruby 1.9  
(svn)  
Date: mar 09 dic 08 08:28:24 +0900

Quoting Kouhei S. (removed\_email\_address@domain.invalid):

> I’m sorry for my late response. I did the same work a month ago.  
> I know that there are many other problems to work with Ruby  
> 1.9 but I have time for now…

No problem of course.

There were a few other things in my patch, that are still not  
corrected in the SVN tree:

1. the rubysig.h include file now gives a warning if inserted :

warning: #warning rubysig.h is obsolete

(in rbgtk.h, rbgobj\_type.c)

1. rb\_thread\_critical seems not to exist anymore. It is referred to in  
rbgobj\_type.c. I have included this line:

static VALUE rb\_thread\_critical=Qfalse;

which seems to work, but I have no idea if this is the right way to  
solve the problem.

1. rb\_progname seems not to exist anymore. It is referred to in  
rbgtkmain.c. I have no idea about how exactly to solve this issue,  
too. What I did is to modify line

EXTERN VALUE rb\_progname;

to

VALUE rb\_progname=Qnil;

(around the beginning), and then, before rb\_progname is used, I added  
these lines

if(rb\_progname==Qnil)  
rb\_progname=rb\_gv\_get("$PROGRAM\_NAME");

You will certainly know what is the right patch to apply 😉

> Thanks,

Thanks to you!

Carlo

–

- 

```
    Se la Strada e la sua Virtu' non fossero state messe da 

```

parte,

- K \* Carlo E. Prelz - removed\_email\_address@domain.invalid che bisogno ci  
sarebbe
  - 

```
          di parlare tanto di amore e di rettitudine? 

```

(Chuang-Tzu)

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 10, 2008, 1:25pm UTC](https://www.ruby-forum.com/t/patch-to-compile-under-ruby-1-9-svn/151837/4 "2008-12-10T13:25:41Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] Patch to compile under ruby 1.9 (svn)” on  
Wed, 10 Dec 2008 10:18:12 +0100,  
“Carlo E. Prelz” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Subject: Re: [ruby-gnome2-devel-en] Patch to compile under ruby 1.9 (svn)  
> Date: mar 09 dic 08 08:28:24 +0900
> 
> Quoting Kouhei S. (removed\_email\_address@domain.invalid):
> 
> > I’m sorry for my late response. I did the same work a month ago.  
> > I know that there are many other problems to work with Ruby  
> > 1.9 but I have time for now…

Oops… I wanted to say “I don’t have time for now…”. :\<

> There were a few other things in my patch, that are still not  
> corrected in the SVN tree:
> 
> 1. the rubysig.h include file now gives a warning if inserted :
> 
> warning: #warning rubysig.h is obsolete
> 
> (in rbgtk.h, rbgobj\_type.c)

done.

> 1. rb\_thread\_critical seems not to exist anymore. It is referred to in  
> rbgobj\_type.c. I have included this line:
> 
> static VALUE rb\_thread\_critical=Qfalse;
> 
> which seems to work, but I have no idea if this is the right way to  
> solve the problem.

done.

> (around the beginning), and then, before rb\_progname is used, I added  
> these lines
> 
> if(rb\_progname==Qnil)  
> rb\_progname=rb\_gv\_get(“$PROGRAM\_NAME”);

We should use rb\_argv0 instead of rb\_progname.

## Thanks,

kou
