Created
June 13, 2016 13:34
-
-
Save marciok/cf016a40b3718fbc59aa205412a8188c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fiddle/import' | |
module PonyScale | |
extend Fiddle::Importer | |
dlload '.build/release/libPonyScale.dylib' # dylib generated by SPM | |
extern 'double _TF9PonyScale15calculateWeightFT4massSd_Sd(double)' # `calculateWeight(_:)` mangled name | |
end | |
weight = PonyScale::_TF9PonyScale15calculateWeightFT4massSd_Sd(18) # Calculating weight by passing 18 as mass | |
puts "Your pony weighs: #{weight}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment