Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.ruby

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 06-17-2012, 04:51 PM
wamrewam@googlemail.com
Guest
 
Posts: n/a
Default Transition to 1.9 - DL/CPtr issue

Hi guys,

I am trying to transition an app to Ruby 1.9 from 1.8.7. This app is calling a shared lib (.so) and it does not work (at all) anymore with the new Ruby.
The reason is there is no more to_ptr with DL in 1.9, but I am struggling to replace it. For instance I had:

extern "bool mclInitializeApplication_proxy(const char**, size_t)"

and in Ruby:

options = ["-nojvm"]
mclInitializeApplication_proxy(options.to_ptr, options.length)

In the Ruby std doc, there is an example:

extern 'double sum(double*, int)'
a = [2.0, 3.0, 4.0]
sum = LibSum.sum(a.pack("d*"), a.count)

so I thought:
CPtr.to_ptr(options.pack("c*")).ptr
would work but it does not (segmentation fault).

Any help would be greatly appreciated, documentation on the new DL is quite limited...

Thanks!
PJ
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 07:55 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.