mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Added DL::BUILD_RUBY_PLATFORM,BUILD_RUBY_VERSION.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
36e3983a27
commit
a7c5e6bcec
2 changed files with 7 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
#include <ruby.h>
|
||||
#include <rubyio.h>
|
||||
#include <version.h>
|
||||
#include <ctype.h>
|
||||
#include "dl.h"
|
||||
|
||||
|
@ -139,7 +140,10 @@ Init_dl()
|
|||
rb_define_module_function(rb_mDL, "malloc", rb_dl_malloc, 1);
|
||||
rb_define_module_function(rb_mDL, "realloc", rb_dl_realloc, 2);
|
||||
rb_define_module_function(rb_mDL, "free", rb_dl_free, 1);
|
||||
|
||||
rb_define_const(rb_mDL, "RUBY_FREE", PTR2NUM(ruby_xfree));
|
||||
rb_define_const(rb_mDL, "BUILD_RUBY_PLATFORM", rb_str_new2(RUBY_PLATFORM));
|
||||
rb_define_const(rb_mDL, "BUILD_RUBY_VERSION", rb_str_new2(RUBY_VERSION));
|
||||
|
||||
Init_dlhandle();
|
||||
Init_dlcfunc();
|
||||
|
|
|
@ -59,6 +59,9 @@ module DL
|
|||
end
|
||||
|
||||
def test_io()
|
||||
if( RUBY_PLATFORM != DL::BUILD_RUBY_PLATFORM )
|
||||
return
|
||||
end
|
||||
io_in,io_out = IO.pipe()
|
||||
LIBC.fprintf(io_out, "hello")
|
||||
io_out.flush()
|
||||
|
|
Loading…
Add table
Reference in a new issue