From 30f7e308d316f72613ce2cf216a8a254ecd0787f Mon Sep 17 00:00:00 2001 From: Luc Street Date: Thu, 6 Jul 2017 18:14:26 -0700 Subject: [PATCH] Use handy LIBSUFFIX from ffi --- ruby-to-rust/src/main.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ruby-to-rust/src/main.rb b/ruby-to-rust/src/main.rb index 146de37..0c0d7c8 100644 --- a/ruby-to-rust/src/main.rb +++ b/ruby-to-rust/src/main.rb @@ -1,14 +1,8 @@ require 'ffi' -if RUBY_PLATFORM.include?('darwin') - EXT = 'dylib' -else - EXT = 'so' -end - module Hello extend FFI::Library - ffi_lib 'target/debug/libdouble_input.' + EXT + ffi_lib 'target/debug/libdouble_input.' + FFI::Platform::LIBSUFFIX attach_function :double_input, [ :int ], :int end