Define Fiddle.last_error family and Fiddle.dlopen statically#172
Merged
kou merged 1 commit intoruby:masterfrom Jan 31, 2025
Merged
Define Fiddle.last_error family and Fiddle.dlopen statically#172kou merged 1 commit intoruby:masterfrom
kou merged 1 commit intoruby:masterfrom
Conversation
`RUBY_ENGINE` and `Fiddle::WINDOWS` should not change in a process, no need to be checked inside the methods. Also, `win32_last_error` and `win32_last_socket_error` are equal to `last_error` on JRuby.
eregon
reviewed
Jan 31, 2025
|
|
||
| # Returns the last +Error+ of the current executing +Thread+ or nil if none | ||
| def self.last_error | ||
| if RUBY_ENGINE == 'jruby' |
Member
There was a problem hiding this comment.
Mmh, actually FFI.last_error{,=} should also use FFI.errno on TruffleRuby, it seems somehow I missed this, maybe because there are no tests for this?
Orthogonal to this PR, so feel free to merge this first.
Member
There was a problem hiding this comment.
Ah it wasn't caught because of
fiddle/test/fiddle/test_function.rb
Lines 128 to 131 in d5fd917
matzbot
pushed a commit
to ruby/ruby
that referenced
this pull request
Feb 3, 2025
statically (ruby/fiddle#172) `RUBY_ENGINE` and `Fiddle::WINDOWS` should not change in a process, no need to be checked inside the methods. Also, `win32_last_error` and `win32_last_socket_error` are equal to `last_error` on JRuby. ruby/fiddle@50ac00ed53
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
RUBY_ENGINEandFiddle::WINDOWSshould not change in a process, no need to be checked inside the methods.Also,
win32_last_errorandwin32_last_socket_errorare equal tolast_erroron JRuby.