Ruby 1.9.3p327(2012-11-10revision37606)
|
00001 /* 00002 * $Id: ruby_missing.h 31149 2011-03-22 11:09:43Z akr $ 00003 * 'OpenSSL for Ruby' project 00004 * Copyright (C) 2001-2003 Michal Rokos <m.rokos@sh.cvut.cz> 00005 * All rights reserved. 00006 */ 00007 /* 00008 * This program is licenced under the same licence as Ruby. 00009 * (See the file 'LICENCE'.) 00010 */ 00011 #if !defined(_OSSL_RUBY_MISSING_H_) 00012 #define _OSSL_RUBY_MISSING_H_ 00013 00014 #define rb_define_copy_func(klass, func) \ 00015 rb_define_method((klass), "initialize_copy", (func), 1) 00016 00017 00018 #ifndef GetReadFile 00019 #define FPTR_TO_FD(fptr) ((fptr)->fd) 00020 #else 00021 #define FPTR_TO_FD(fptr) (fileno(GetReadFile(fptr))) 00022 #endif 00023 00024 #ifndef HAVE_RB_IO_T 00025 #define rb_io_t OpenFile 00026 #endif 00027 00028 #ifndef HAVE_RB_STR_SET_LEN 00029 /* these methods should probably be backported to 1.8 */ 00030 #define rb_str_set_len(str, length) do { \ 00031 RSTRING(str)->ptr[(length)] = 0; \ 00032 RSTRING(str)->len = (length); \ 00033 } while(0) 00034 #endif /* ! HAVE_RB_STR_SET_LEN */ 00035 00036 #ifndef HAVE_RB_BLOCK_CALL 00037 /* the openssl module doesn't use arg[3-4] and arg2 is always rb_each */ 00038 #define rb_block_call(arg1, arg2, arg3, arg4, arg5, arg6) rb_iterate(rb_each, (arg1), (arg5), (arg6)) 00039 #endif /* ! HAVE_RB_BLOCK_CALL */ 00040 00041 #endif /* _OSSL_RUBY_MISSING_H_ */ 00042