-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for OTP-22 #212
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4eed7d4
Add support for OTP22 (Erlang NIF 2.15)
filmor af8ea91
Add OTP-22 to travis
filmor 5c5268b
Update the failure message in gen_api.erl
filmor 153f776
Fix typo in minor version number
filmor e612edf
Sleep before checking the resource count when testing
filmor 58f9182
Add remaining new API functions
filmor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,15 @@ version_opts("2.13") -> [{major,2}, {minor,13}, exception, getenv, time, % erl | |
version_opts("2.14") -> [{major,2}, {minor,14}, exception, getenv, time, % erlang 21.0 | ||
dirty_scheduler_opt, nif_2_11, nif_2_12, nif_2_13, | ||
nif_2_14]; | ||
version_opts(_) -> | ||
io:format("Unsupported Erlang version.\n\nIs the erlang_nif-sys version up to date in the Cargo.toml?\nDoes 'cargo update' fix it?\nIf not please report at https://github.com/goertzenator/erlang_nif-sys.\n"), | ||
version_opts("2.15") -> [{major,2}, {minor,15}, exception, getenv, time, % erlang 22.0 | ||
dirty_scheduler_opt, nif_2_11, nif_2_12, nif_2_13, | ||
nif_2_14, nif_2_15]; | ||
version_opts(Ver) -> | ||
io:format( | ||
"This OTP release uses the unsupported Erlang NIF version ~p.\n\n" | ||
"Please report at https://github.com/rustlerium/rustler.\n", | ||
[Ver] | ||
), | ||
halt(1). | ||
|
||
ulong_opts("4") -> [{ulongsize, 4}]; | ||
|
@@ -344,11 +351,24 @@ api_list(Opts) -> [ | |
{"", "dummy_enif_vfprintf", ""}, | ||
{"", "dummy_enif_vsnprintf", ""}, | ||
|
||
{"c_int", "enif_make_map_from_arrays", "env: *mut ErlNifEnv, keys: *const ERL_NIF_TERM, values: *const ERL_NIF_TERM, cnt: usize, map_out: *mut ERL_NIF_TERM"} | ||
{"c_int", "enif_make_map_from_arrays", "env: *mut ErlNifEnv, keys: *const ERL_NIF_TERM, values: *const ERL_NIF_TERM, cnt: usize, map_out: *mut ERL_NIF_TERM"} | ||
]; | ||
false -> [] | ||
end. | ||
end ++ | ||
case proplists:get_bool(nif_2_15, Opts) of | ||
true -> [ | ||
{"ErlNifTermType", "enif_term_type", "env: *mut ErlNifEnv, term: *const ERL_NIF_TERM"}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is nice! |
||
|
||
{"c_int", "enif_compare_pids", "pid1: *const ErlNifPid, pid2: *const ErlNifPid"}, | ||
{"c_int", "enif_is_pid_undefined", "pid: *const ErlNifPid"}, | ||
{"", "enif_set_pid_undefined", "pid: *mut ErlNifPid"}, | ||
{"ERL_NIF_TERM", "enif_make_monitor_term", "env: *mut ErlNifEnv, mon: *const ErlNifMonitor"}, | ||
|
||
{"c_int", "enif_select_read", "env: *mut ErlNifEnv, e: ErlNifEvent, obj: *const c_void, pid: *const ErlNifPid, msg: *const ERL_NIF_TERM, msg_env: *mut ErlNifEnv"}, | ||
{"c_int", "enif_select_write", "env: *mut ErlNifEnv, e: ErlNifEvent, obj: *const c_void, pid: *const ErlNifPid, msg: *const ERL_NIF_TERM, msg_env: *mut ErlNifEnv"} | ||
]; | ||
false -> [] | ||
end. | ||
|
||
|
||
main([UlongSizeT]) -> main([UlongSizeT,"."]); | ||
|
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/the/an
This OTP release uses an unsupported...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the message contains the version, so it reads
This OTP release uses the unsupported Erlang NIF version 2.15
;)