ffi 1.0.12.rc3-x86-mingw32 → 1.1.0.rc2-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ffi might be problematic. Click here for more details.
- data/README.rdoc +46 -0
- data/Rakefile +4 -2
- data/ext/ffi_c/AbstractMemory.c +13 -0
- data/ext/ffi_c/LongDouble.h +3 -0
- data/ext/ffi_c/libffi.bsd.mk +1 -1
- data/ext/ffi_c/libffi.darwin.mk +1 -0
- data/ext/ffi_c/libffi.gnu.mk +4 -2
- data/lib/1.8/ffi_c.so +0 -0
- data/lib/1.9/ffi_c.so +0 -0
- data/lib/ffi/struct.rb +4 -3
- data/spec/ffi/struct_spec.rb +9 -0
- metadata +6 -6
data/README.rdoc
CHANGED
@@ -54,3 +54,49 @@ or from the git repository on github:
|
|
54
54
|
== LICENSE:
|
55
55
|
|
56
56
|
See LICENSE file.
|
57
|
+
|
58
|
+
== CREDITS
|
59
|
+
|
60
|
+
The following people have submitted code, bug reports, or otherwide contributed to the success of this project:
|
61
|
+
|
62
|
+
Alban Peignier <alban.peignier@free.fr>
|
63
|
+
Aman Gupta <aman@tmm1.net>
|
64
|
+
Andrea Fazzi <andrea.fazzi@alcacoop.it>
|
65
|
+
Andreas Niederl <rico32@gmx.net>
|
66
|
+
Andrew Cholakian <andrew@andrewvc.com>
|
67
|
+
Antonio Terceiro <terceiro@softwarelivre.org>
|
68
|
+
Brian Candler <B.Candler@pobox.com>
|
69
|
+
Brian D. Burns <burns180@gmail.com>
|
70
|
+
Bryan Kearney <bkearney@redhat.com>
|
71
|
+
Charlie Savage <cfis@zerista.com>
|
72
|
+
Chikanaga Tomoyuki <nagachika00@gmail.com>
|
73
|
+
Hongli Lai <hongli@phusion.nl>
|
74
|
+
Ian MacLeod <ian@nevir.net>
|
75
|
+
Jake Douglas <jake@shiftedlabs.com>
|
76
|
+
Jean-Dominique Morani <jdmorani@mac.com>
|
77
|
+
Jeremy Hinegardner <jeremy@hinegardner.org>
|
78
|
+
Jesús García Sáez <blaxter@gmail.com>
|
79
|
+
Joe Khoobyar <joe@ankhcraft.com>
|
80
|
+
Jurij Smakov <jurij@wooyd.org>
|
81
|
+
KISHIMOTO, Makoto <ksmakoto@dd.iij4u.or.jp>
|
82
|
+
Kim Burgestrand <kim@burgestrand.se>
|
83
|
+
Lars Kanis <kanis@comcard.de>
|
84
|
+
Luc Heinrich <luc@honk-honk.com>
|
85
|
+
Luis Lavena <luislavena@gmail.com>
|
86
|
+
Matijs van Zuijlen <matijs@matijs.net>
|
87
|
+
Matthew King <automatthew@gmail.com>
|
88
|
+
Mike Dalessio <mike.dalessio@gmail.com>
|
89
|
+
NARUSE, Yui <naruse@airemix.jp>
|
90
|
+
Park Heesob <phasis@gmail.com>
|
91
|
+
Shin Yee <shinyee@speedgocomputing.com>
|
92
|
+
Stephen Bannasch <stephen.bannasch@gmail.com>
|
93
|
+
Suraj N. Kurapati <sunaku@gmail.com>
|
94
|
+
Sylvain Daubert <sylvain.daubert@laposte.net>
|
95
|
+
Victor Costan
|
96
|
+
beoran@gmail.com
|
97
|
+
ctide <christide@christide.com>
|
98
|
+
emboss <Martin.Bosslet@googlemail.com>
|
99
|
+
hobophobe <unusualtears@gmail.com>
|
100
|
+
meh <meh@paranoici.org>
|
101
|
+
postmodern <postmodern.mod3@gmail.com>
|
102
|
+
wycats@gmail.com <wycats@gmail.com>
|
data/Rakefile
CHANGED
@@ -5,7 +5,6 @@ USE_RAKE_COMPILER = (RUBY_PLATFORM =~ /java/) ? false : true
|
|
5
5
|
if USE_RAKE_COMPILER
|
6
6
|
gem 'rake-compiler', '>=0.6.0'
|
7
7
|
require 'rake/extensiontask'
|
8
|
-
ENV['RUBY_CC_VERSION'] = '1.8.7:1.9.3'
|
9
8
|
end
|
10
9
|
|
11
10
|
require 'date'
|
@@ -75,7 +74,7 @@ PROJ.name = 'ffi'
|
|
75
74
|
PROJ.authors = 'Wayne Meissner'
|
76
75
|
PROJ.email = 'wmeissner@gmail.com'
|
77
76
|
PROJ.url = 'http://wiki.github.com/ffi/ffi'
|
78
|
-
PROJ.version = '1.0.
|
77
|
+
PROJ.version = '1.1.0.rc2'
|
79
78
|
PROJ.rubyforge.name = 'ffi'
|
80
79
|
PROJ.readme_file = 'README.rdoc'
|
81
80
|
|
@@ -189,3 +188,6 @@ task 'spec:specdoc' => TEST_DEPS
|
|
189
188
|
|
190
189
|
task :default => :specs
|
191
190
|
|
191
|
+
task 'gem:win32' do
|
192
|
+
sh("rake cross native gem RUBY_CC_VERSION='1.8.7:1.9.3'") || raise("win32 build failed!")
|
193
|
+
end
|
data/ext/ffi_c/AbstractMemory.c
CHANGED
@@ -591,6 +591,18 @@ memory_address(VALUE obj)
|
|
591
591
|
return ((AbstractMemory *) DATA_PTR(obj))->address;
|
592
592
|
}
|
593
593
|
|
594
|
+
static VALUE
|
595
|
+
memory_copy_from(VALUE self, VALUE rbsrc, VALUE rblen)
|
596
|
+
{
|
597
|
+
AbstractMemory* dst;
|
598
|
+
|
599
|
+
Data_Get_Struct(self, AbstractMemory, dst);
|
600
|
+
|
601
|
+
memcpy(dst->address, rbffi_AbstractMemory_Cast(rbsrc, rbffi_AbstractMemoryClass)->address, NUM2INT(rblen));
|
602
|
+
|
603
|
+
return self;
|
604
|
+
}
|
605
|
+
|
594
606
|
AbstractMemory*
|
595
607
|
rbffi_AbstractMemory_Cast(VALUE obj, VALUE klass)
|
596
608
|
{
|
@@ -1008,6 +1020,7 @@ rbffi_AbstractMemory_Init(VALUE moduleFFI)
|
|
1008
1020
|
rb_define_alias(classMemory, "size", "total");
|
1009
1021
|
rb_define_method(classMemory, "type_size", memory_type_size, 0);
|
1010
1022
|
rb_define_method(classMemory, "[]", memory_aref, 1);
|
1023
|
+
rb_define_method(classMemory, "__copy_from__", memory_copy_from, 2);
|
1011
1024
|
|
1012
1025
|
id_to_ptr = rb_intern("to_ptr");
|
1013
1026
|
id_call = rb_intern("call");
|
data/ext/ffi_c/LongDouble.h
CHANGED
data/ext/ffi_c/libffi.bsd.mk
CHANGED
@@ -7,7 +7,7 @@ INCFLAGS += -I${LIBFFI_BUILD_DIR}/include
|
|
7
7
|
LOCAL_LIBS += ${LIBFFI} -lpthread
|
8
8
|
|
9
9
|
LIBFFI_CFLAGS = ${FFI_MMAP_EXEC} -pthread
|
10
|
-
LIBFFI_BUILD_DIR = ${.CURDIR}/libffi
|
10
|
+
LIBFFI_BUILD_DIR = ${.CURDIR}/libffi-${arch}
|
11
11
|
|
12
12
|
.if ${srcdir} == "."
|
13
13
|
LIBFFI_SRC_DIR := ${.CURDIR}/libffi
|
data/ext/ffi_c/libffi.darwin.mk
CHANGED
data/ext/ffi_c/libffi.gnu.mk
CHANGED
@@ -9,12 +9,14 @@ INCFLAGS += -I"$(LIBFFI_BUILD_DIR)"/include
|
|
9
9
|
LOCAL_LIBS += $(LIBFFI)
|
10
10
|
BUILD_DIR = $(shell pwd)
|
11
11
|
LIBFFI_CFLAGS = $(FFI_MMAP_EXEC)
|
12
|
-
LIBFFI_BUILD_DIR = $(BUILD_DIR)/libffi
|
12
|
+
LIBFFI_BUILD_DIR = $(BUILD_DIR)/libffi-$(arch)
|
13
13
|
|
14
14
|
ifeq ($(srcdir),.)
|
15
15
|
LIBFFI_SRC_DIR := $(shell pwd)/libffi
|
16
|
+
else ifeq ($(srcdir),..)
|
17
|
+
LIBFFI_SRC_DIR := $(shell pwd)/../libffi
|
16
18
|
else
|
17
|
-
LIBFFI_SRC_DIR := $(
|
19
|
+
LIBFFI_SRC_DIR := $(realpath $(srcdir)/libffi)
|
18
20
|
endif
|
19
21
|
|
20
22
|
LIBFFI = "$(LIBFFI_BUILD_DIR)"/.libs/libffi_convenience.a
|
data/lib/1.8/ffi_c.so
CHANGED
Binary file
|
data/lib/1.9/ffi_c.so
CHANGED
Binary file
|
data/lib/ffi/struct.rb
CHANGED
@@ -52,9 +52,10 @@ module FFI
|
|
52
52
|
type.struct_class.new(ptr.slice(self.offset, self.size))
|
53
53
|
end
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
def put(ptr, value)
|
56
|
+
raise TypeError, "wrong value type (expected #{type.struct_class}" unless value.is_a?(type.struct_class)
|
57
|
+
ptr.slice(self.offset, self.size).__copy_from__(value.pointer, self.size)
|
58
|
+
end
|
58
59
|
end
|
59
60
|
|
60
61
|
class Mapped < Field
|
data/spec/ffi/struct_spec.rb
CHANGED
@@ -442,6 +442,15 @@ describe FFI::Struct, ' with a nested struct field' do
|
|
442
442
|
@cs[:ns][:i] = 456
|
443
443
|
LibTest.struct_align_nested_struct(@cs.to_ptr).should eq 456
|
444
444
|
end
|
445
|
+
|
446
|
+
it 'should be able to assign struct instance to nested field' do
|
447
|
+
cs = LibTest::ContainerStruct.new(LibTest.struct_make_container_struct(123))
|
448
|
+
ns = LibTest::NestedStruct.new
|
449
|
+
ns[:i] = 567
|
450
|
+
cs[:ns] = ns
|
451
|
+
cs[:ns][:i].should eq 567
|
452
|
+
LibTest.struct_align_nested_struct(cs.to_ptr).should eq 567
|
453
|
+
end
|
445
454
|
end
|
446
455
|
|
447
456
|
describe FFI::Struct, ' with a nested array of structs' do
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: -2431023002
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
- 12
|
10
10
|
- rc
|
11
|
-
-
|
12
|
-
version: 1.0.
|
11
|
+
- 2
|
12
|
+
version: 1.1.0.rc2
|
13
13
|
platform: x86-mingw32
|
14
14
|
authors:
|
15
15
|
- Wayne Meissner
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2012-04-
|
20
|
+
date: 2012-04-05 00:00:00 +10:00
|
21
21
|
default_executable:
|
22
22
|
dependencies: []
|
23
23
|
|