Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/fiddle/commit/fd4bb4ea8a
|
|
GitHub: fix https://github.com/ruby/fiddle/pull/130
Reported by Benoit Daloze. Thanks!!!
https://github.com/ruby/fiddle/commit/2640e0148e
|
|
GitHub: fix https://github.com/ruby/fiddle/pull/130
Reported by Benoit Daloze. Thanks!!!
https://github.com/ruby/fiddle/commit/bc6c66bbb9
|
|
https://github.com/ruby/fiddle/commit/2b22bb9d74
|
|
GitHub: fix https://github.com/ruby/fiddle/pull/100
Reported by David M. Lary. Thanks!!!
https://github.com/ruby/fiddle/commit/516333dd78
|
|
(https://github.com/ruby/fiddle/pull/118)
String#unpack1 is available since Ruby 2.4, and support for older than
Ruby 2.5 was dropped by #85.
Also simplified a common return statement.
Notes:
Merged: https://github.com/ruby/ruby/pull/7025
|
|
https://github.com/ruby/fiddle/commit/3033266902
Notes:
Merged: https://github.com/ruby/ruby/pull/7025
|
|
GitHub: fix https://github.com/ruby/fiddle/pull/107
Reported by nicholas a. evans. Thanks!!!
https://github.com/ruby/fiddle/commit/49ea1490df
Notes:
Merged: https://github.com/ruby/ruby/pull/6576
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6576
|
|
GitHub: fix GH-102
It's for freeing a closure explicitly.
We can't use Fiddle::Closure before we fork the process. If we do it,
the process may be crashed with SELinux.
See https://github.com/ruby/fiddle/issues/102#issuecomment-1241763091
for details.
Reported by Vít Ondruch. Thanks!!!
https://github.com/ruby/fiddle/commit/a0ccc6bb1b
|
|
(https://github.com/ruby/fiddle/pull/112)
This helps to reduce repetition in code. Instead of doing "TYPE_*"
everywhere, you can do `include Fiddle::Types`, and write the type name
directly.
This PR is to help reduce repetition when writing Fiddle code. Right now
we have to type `TYPE_` everywhere, and you also have to include all of
`Fiddle` to access `TYPE_*` constants. With this change, you can just
include `Fiddle::Types` and it will shorten your code and also you only
have to include those constants.
Here is an example before:
```ruby
require "fiddle"
module MMAP
# All Fiddle constants included
include Fiddle
def self.make_function name, args, ret
ptr = Handle::DEFAULT[name]
func = Function.new ptr, args, ret, name: name
define_singleton_method name, &func.to_proc
end
make_function "munmap", [TYPE_VOIDP, # addr
TYPE_SIZE_T], # len
TYPE_INT
make_function "mmap", [TYPE_VOIDP,
TYPE_SIZE_T,
TYPE_INT,
TYPE_INT,
TYPE_INT,
TYPE_INT], TYPE_VOIDP
make_function "mprotect", [TYPE_VOIDP, TYPE_SIZE_T, TYPE_INT], TYPE_INT
end
```
After:
```ruby
require "fiddle"
module MMAP
# Only type names included
include Fiddle::Types
def self.make_function name, args, ret
ptr = Fiddle::Handle::DEFAULT[name]
func = Fiddle::Function.new ptr, args, ret, name: name
define_singleton_method name, &func.to_proc
end
make_function "munmap", [VOIDP, # addr
SIZE_T], # len
INT
make_function "mmap", [VOIDP, SIZE_T, INT, INT, INT, INT], VOIDP
make_function "mprotect", [VOIDP, SIZE_T, INT], INT
end
```
We only need to import the type names, and you don't have to type
`TYPE_` over and over. I think this makes Fiddle code easier to read.
https://github.com/ruby/fiddle/commit/49fa7233e5
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
|
|
(https://github.com/ruby/fiddle/pull/111)
This commit adds constants for unsigned values. Currently we can use `-`
to mean "unsigned", but I think having a specific name makes Fiddle more
user friendly. This commit continues to support `-`, but introduces
negative constants with "unsigned" names
I think this will help to eliminate [this
code](https://github.com/ruby/ruby/blob/3a56bf0bcc66e14ffe5ec89efc32ecfceed180f4/lib/mjit/c_type.rb#L31-L38)
https://github.com/ruby/fiddle/commit/2bef0f1082
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
|
|
(https://github.com/ruby/fiddle/pull/110)
https://github.com/ruby/fiddle/commit/4a71246645ccff001292c9d80b855b2ef5bf06c1
|
|
(https://github.com/ruby/fiddle/pull/90)
I need to get the offset of members inside sub structures. This patch
adds sub-structure offset support for structs.
https://github.com/ruby/fiddle/commit/cf78eddbb6
|
|
(https://github.com/ruby/fiddle/pull/83)
* Add "offsetof" to Struct classes
I need to get the offset of a member inside a struct without allocating
the struct. This patch adds an "offsetof" class method to structs that
are generated.
The usage is like this:
```ruby
MyStruct = struct [
"int64_t i",
"char c",
]
MyStruct.offsetof("i") # => 0
MyStruct.offsetof("c") # => 8
```
* Update test/fiddle/test_c_struct_builder.rb
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
https://github.com/ruby/fiddle/commit/4e3b60c5b6
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
|
|
https://github.com/ruby/fiddle/commit/049138b4b8
|
|
https://github.com/ruby/fiddle/commit/3784cfeec4
|
|
GitHub: fix GH-72
Users can't use WSAGetLastError() with Ruby 3.0 or later because
rb_funcall() resets the last socket error internally.
Users can get the last socket error by Fiddle.win32_last_socket_error.
Reported by Kentaro Hayashi. Thanks!!!
https://github.com/ruby/fiddle/commit/76158db00a
Notes:
Merged: https://github.com/ruby/ruby/pull/4506
|
|
GitHub: fix #68
Reported by kojix2. Thanks!!!
https://github.com/ruby/fiddle/commit/d7322c234a
Notes:
Merged: https://github.com/ruby/ruby/pull/4506
|
|
https://github.com/ruby/fiddle/commit/35dec6c5a5
Notes:
Merged: https://github.com/ruby/ruby/pull/4506
|
|
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types
https://github.com/ruby/fiddle/commit/805c1a595a
Notes:
Merged: https://github.com/ruby/ruby/pull/4506
|
|
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types
https://github.com/ruby/fiddle/commit/28ee5b1608
Notes:
Merged: https://github.com/ruby/ruby/pull/4506
|
|
https://github.com/ruby/fiddle/commit/0cbd370fd6
Notes:
Merged: https://github.com/ruby/ruby/pull/4506
|
|
https://github.com/ruby/fiddle/commit/63e5f98412
Notes:
Merged: https://github.com/ruby/ruby/pull/4506
|
|
|
|
This lets us cast a Fiddle::Function to a block, allowing is to write
things like:
```ruby
f = Fiddle::Function.new(@libc['strcpy'], [TYPE_VOIDP, TYPE_VOIDP], TYPE_VOIDP)
define_method :strcpy, &f
```
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3970
|
|
I don't use tool/sync_default_gem.rb because the last sync was incomplete.
Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Co-authored-by: sinisterchipmunk <sinisterchipmunk@gmail.com>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
|
|
https://github.com/ruby/fiddle/commit/74b65cb858
Notes:
Merged: https://github.com/ruby/ruby/pull/3780
|
|
GitHub: fix GH-15
Reported by Eneroth3. Thanks!!!
https://github.com/ruby/fiddle/commit/f3d70b81ec
Notes:
Merged: https://github.com/ruby/ruby/pull/3780
|
|
Add rb_fiddle_ prefix to conversion functions.h to keep backward
compatibility but value_to_generic() isn't safe for TYPE_CONST_STRING
and not String src. Use rb_fiddle_value_to_generic() instead.
https://github.com/ruby/fiddle/commit/0ffcaa39e5
Notes:
Merged: https://github.com/ruby/ruby/pull/3780
|
|
memory in tests (#33)
https://github.com/ruby/fiddle/commit/e59cfd708a
|
|
https://github.com/ruby/fiddle/commit/1b93a2d9db
Notes:
Merged: https://github.com/ruby/ruby/pull/3068
|
|
https://github.com/ruby/fiddle/commit/445ca6b501
Notes:
Merged: https://github.com/ruby/ruby/pull/3068
|
|
https://github.com/ruby/fiddle/commit/f8fb7c4823
Notes:
Merged: https://github.com/ruby/ruby/pull/3068
|
|
https://github.com/ruby/fiddle/commit/9dcf64c096
Notes:
Merged: https://github.com/ruby/ruby/pull/3068
|
|
* Allow access to a struct's underlying memory with `struct[offset, length]`.
https://github.com/ruby/fiddle/commit/24083690a6
Notes:
Merged: https://github.com/ruby/ruby/pull/3068
|
|
* Allow access to a struct's underlying memory with `struct[offset, length]`.
* Make accessing a struct's underlying memory more convenient.
* refactor memory access unit tests for improved clarity
https://github.com/ruby/fiddle/commit/c082c81bb5
Notes:
Merged: https://github.com/ruby/ruby/pull/3068
|
|
* ext/fiddle/lib/fiddle/import.rb: suppress exception report when
$DEBUG is enabled. [ruby-core:86536] [Bug #14686]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
Fixes: r62450 (commit 1aaeeb326e754c5c5db83fbf35f780f729a9dfed)
("long long is a C99ism")
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
so SIZEOF_LONG_LONG is not always available.
We have to check its defined?-ness before using.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
https://github.com/ruby/ruby/pull/1666
Patch by @guilherme [fix GH-1666]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/fiddle/closure.c: use directly declaration for standalone gem
without internal.h.
* Specify frozen string literal is true.
* Update gemspec configuration for release version.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/fiddle/lib/fiddle/import.rb (type_alias, handler): suppress
"not initialized instance variable" warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts
fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&#
frozen_string_literal: false\n");f.rewind;f.write s}}'
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/fiddle/lib/fiddle/cparser.rb (parse_ctype): limit split word
number as the rest are not used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
type_alias
* test/fiddle/test_cparser.rb: added type_alias test for parse_ctype
and parse_struct_signature.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
to handle rich signatures including parameter names and function
pointer types. Patch by @theryan [fix GH-590]
* test/fiddle/test_cparser.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|