Permalink
Browse files

Add handling for varargs in FFI

  • Loading branch information...
dbussink committed Aug 10, 2012
1 parent 90510ba commit eee9e94db471136d124a97bccd9ef75a9cbdc776
Showing with 208 additions and 193 deletions.
  1. +4 −0 kernel/platform/ffi.rb
  2. +2 −3 vm/builtin/ffi_pointer.cpp
  3. +186 −187 vm/builtin/nativefunction.cpp
  4. +5 −0 vm/builtin/nativefunction.hpp
  5. +3 −1 vm/ffi.cpp
  6. +1 −0 vm/ffi_util.hpp
  7. +2 −0 vm/globals.hpp
  8. +5 −2 vm/llvm/inline.cpp
View
@@ -151,6 +151,9 @@ def errno
add_typedef TYPE_INT, :int32
add_typedef TYPE_UINT, :uint32
+ # Converts a varargs argument
+ add_typedef TYPE_VARARGS, :varargs
+
if Rubinius::L64
add_typedef TYPE_LONG, :int64
add_typedef TYPE_ULONG, :uint64
@@ -214,6 +217,7 @@ def initialize(struct)
STRPTR = TYPE_STRPTR
CHARARR = TYPE_CHARARR
ENUM = TYPE_ENUM
+ VARARGS = TYPE_VARARGS
end
end
@@ -37,8 +37,7 @@
namespace rubinius {
void Pointer::init(STATE) {
- Module* ffi = as<Module>(G(object)->get_const(state, "FFI"));
- GO(ffi_pointer).set(ontology::new_class_under(state, "Pointer", ffi));
+ GO(ffi_pointer).set(ontology::new_class_under(state, "Pointer", G(ffi)));
G(ffi_pointer)->set_object_type(state, PointerType);
G(ffi_pointer)->set_const(state, "CURRENT_PROCESS",
@@ -67,7 +66,7 @@ namespace rubinius {
#endif
#endif
- ffi->set_const(state, "LIB_SUFFIXES", suffix);
+ G(ffi)->set_const(state, "LIB_SUFFIXES", suffix);
// Legacy. Fix the kernel to not need this.
String* main_suffix;
Oops, something went wrong.

0 comments on commit eee9e94

Please sign in to comment.