diff options
author | tduehr <tduehr@gmail.com> | 2014-07-01 12:35:45 -0500 |
---|---|---|
committer | tduehr <tduehr@gmail.com> | 2014-07-01 12:35:45 -0500 |
commit | 39febea8d7ed13e1ebc8747fd6fae09f475e6c17 (patch) | |
tree | ad9afc074ee3b83b087e1e2dc66a80bc568f732a /spec/ffi/struct_spec.rb | |
parent | e07799acbff814fab5b3c523c18663420eda512b (diff) | |
download | ffi-39febea8d7ed13e1ebc8747fd6fae09f475e6c17.tar.gz |
fix tests for netbsd
Diffstat (limited to 'spec/ffi/struct_spec.rb')
-rw-r--r-- | spec/ffi/struct_spec.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/ffi/struct_spec.rb b/spec/ffi/struct_spec.rb index 233cf09..aa4fa40 100644 --- a/spec/ffi/struct_spec.rb +++ b/spec/ffi/struct_spec.rb @@ -20,7 +20,12 @@ describe "Struct tests" do extend FFI::Library ffi_lib TestLibrary::PATH attach_function :ptr_ret_pointer, [ :pointer, :int], :string - attach_function :ptr_ret_int32_t, [ :pointer, :int ], :int + begin + attach_function :ptr_ret_int32_t, [ :pointer, :int ], :int + rescue FFI::NotFoundError + # NetBSD uses #define instead of typedef for these + attach_function :ptr_ret_int32_t, :ptr_ret___int32_t, [ :pointer, :int ], :int + end attach_function :ptr_from_address, [ :ulong ], :pointer attach_function :string_equals, [ :string, :string ], :int [ 's8', 's16', 's32', 's64', 'f32', 'f64', 'long' ].each do |t| @@ -401,7 +406,12 @@ describe FFI::Struct, ".layout" do module LibTest extend FFI::Library ffi_lib TestLibrary::PATH - attach_function :ptr_ret_int32_t, [ :pointer, :int ], :int + begin + attach_function :ptr_ret_int32_t, [ :pointer, :int ], :int + rescue FFI::NotFoundError + # NetBSD uses #define instead of typedef for these + attach_function :ptr_ret_int32_t, :ptr_ret___int32_t, [ :pointer, :int ], :int + end end end |