Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Support nif 2.9 in OTP 18.2 #6

Merged
merged 1 commit into from
Jan 21, 2016
Merged

Conversation

tatsuya6502
Copy link
Contributor

Add enif_getenv() function to support nif 2.9. enif_getenv() was introduced to Erlang/OTP 18.2 by this commit: erlang/otp@ef45d2c

Manually tested with a modified version of ruster_unsafe_demo: tatsuya6502/ruster_unsafe_demo@839db58

% git remote -v
origin  git@github.com:tatsuya6502/ruster_unsafe_demo.git (fetch)
origin  git@github.com:tatsuya6502/ruster_unsafe_demo.git (push)
% git branch
  master
* nif-2.9
% cargo build
    Updating git repository `https://github.com/tatsuya6502/ruster_unsafe/`
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling ruster_unsafe v0.2.0 (https://github.com/tatsuya6502/ruster_unsafe/?rev=nif-2.9#2f68285f)
   Compiling libc v0.2.4
   Compiling ruster_unsafe_demo v0.0.1 (file:///usr/home/tatsuya/workhub/dev/ruster_unsafe_demo)
% erlc ruster_unsafe_demo.erl
%
% erl
Erlang/OTP 18 [erts-7.2.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V7.2.1  (abort with ^G)
1> ruster_unsafe_demo:getenv("HOME").
"/home/tatsuya"
2> ruster_unsafe_demo:getenv("UNDEFINED").
** exception error: bad argument
     in function  ruster_unsafe_demo:getenv/1
        called as ruster_unsafe_demo:getenv("UNDEFINED")
3> os:getenv("HOME").
"/home/tatsuya"
4> os:getenv("UNDEFINED").
false

@goertzenator
Copy link
Collaborator

Thanks!

@hansihe
Copy link
Member

hansihe commented Jan 21, 2016

Is there any particular reason why this wasn't merged? Anything I can do to help?

@goertzenator
Copy link
Collaborator

I could have sworn I merged this. Apologies. Thanks for poking me.

@goertzenator goertzenator reopened this Jan 21, 2016
goertzenator added a commit that referenced this pull request Jan 21, 2016
Support nif 2.9 in OTP 18.2
@goertzenator goertzenator merged commit 2f7497b into rusterlium:master Jan 21, 2016
@goertzenator
Copy link
Collaborator

Ah, it makes you hit merge twice as confirmation. I must have only hit it once the first time.

@hansihe
Copy link
Member

hansihe commented Jan 21, 2016

Ah, right, thank you :)

@hansihe
Copy link
Member

hansihe commented Jan 21, 2016

Would you mind bumping the version number and uploading the newest version to crates? I can make a pull request if it's easier for you.

@goertzenator
Copy link
Collaborator

Crate 0.3.0 has been published.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants