rusterlium / erlang_nif-sys

Low level bindings to Erlang NIF API for Rust
Apache License 2.0
90 stars 19 forks source link

Update for nif version 2.8 #4

Closed hansihe closed 9 years ago

hansihe commented 9 years ago

Along with OTP 18, the nif api version number was bumped up to 2.8. According to the version history in the file erl_nif.h, this new version added one new function, enif_has_pending_exception.

Adding support for this one function should be trivial, and I would absolutely be willing to submit a pull request. I am however slightly unsure how you would handle multiple different versions of the nif api in the codebase. Would you like to keep compatibility with 2.7, or would a new release remove support for this version in favor of 2.8?

goertzenator commented 9 years ago

Pleased to have your help!

The project was made to be compatible with multiple NIF API versions, and keeping compatibility is easy. The part you need to tweak is here.

I think you'll just need to add a {2,8} clause that produces the expanded api list. The {2,7} clause must continue to work as it does now.

goertzenator commented 9 years ago

Fixed in https://github.com/goertzenator/ruster_unsafe/commit/e78210a41465f109725e087e718272e9073ed9e4