ffi 1.9.6 → 1.9.8
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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/Rakefile +9 -9
- data/ext/ffi_c/Call.c +85 -20
- data/ext/ffi_c/Variadic.c +6 -2
- data/ext/ffi_c/libffi/src/x86/win32.S +2 -2
- data/ffi.gemspec +1 -1
- data/lib/ffi.rb +6 -4
- data/lib/ffi/enum.rb +12 -6
- data/lib/ffi/library.rb +21 -1
- data/lib/ffi/platform.rb +2 -0
- data/lib/ffi/platform/aarch64-linux/types.conf +104 -0
- data/lib/ffi/platform/mips64el-linux/types.conf +104 -0
- data/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
- data/lib/ffi/platform/x86_64-darwin/types.conf +30 -4
- data/lib/ffi/struct.rb +6 -0
- data/lib/ffi/version.rb +1 -1
- data/libtest/EnumTest.c +17 -0
- data/spec/ffi/enum_spec.rb +196 -0
- data/spec/ffi/fixtures/EnumTest.c +17 -0
- data/spec/ffi/function_spec.rb +7 -4
- metadata +6 -18
- data/spec/ffi/fixtures/Benchmark.o +0 -0
- data/spec/ffi/fixtures/BoolTest.o +0 -0
- data/spec/ffi/fixtures/BufferTest.o +0 -0
- data/spec/ffi/fixtures/ClosureTest.o +0 -0
- data/spec/ffi/fixtures/EnumTest.o +0 -0
- data/spec/ffi/fixtures/FunctionTest.o +0 -0
- data/spec/ffi/fixtures/GlobalVariable.o +0 -0
- data/spec/ffi/fixtures/LastErrorTest.o +0 -0
- data/spec/ffi/fixtures/NumberTest.o +0 -0
- data/spec/ffi/fixtures/PointerTest.o +0 -0
- data/spec/ffi/fixtures/ReferenceTest.o +0 -0
- data/spec/ffi/fixtures/StringTest.o +0 -0
- data/spec/ffi/fixtures/StructTest.o +0 -0
- data/spec/ffi/fixtures/UnionTest.o +0 -0
- data/spec/ffi/fixtures/VariadicTest.o +0 -0
@@ -3,6 +3,7 @@
|
|
3
3
|
*
|
4
4
|
* For licensing, see LICENSE.SPECS
|
5
5
|
*/
|
6
|
+
#include <stdint.h>
|
6
7
|
|
7
8
|
int test_untagged_enum(int val) {
|
8
9
|
return val;
|
@@ -12,6 +13,22 @@ int test_untagged_typedef_enum(int val) {
|
|
12
13
|
return val;
|
13
14
|
}
|
14
15
|
|
16
|
+
uint8_t test_untagged_nonint_enum(uint8_t val) {
|
17
|
+
return val;
|
18
|
+
}
|
19
|
+
|
20
|
+
uint16_t test_tagged_nonint_enum1(uint16_t val) {
|
21
|
+
return val;
|
22
|
+
}
|
23
|
+
|
24
|
+
uint32_t test_tagged_nonint_enum2(uint32_t val) {
|
25
|
+
return val;
|
26
|
+
}
|
27
|
+
|
28
|
+
uint64_t test_tagged_nonint_enum3(uint64_t val) {
|
29
|
+
return val;
|
30
|
+
}
|
31
|
+
|
15
32
|
typedef enum {c1, c2, c3, c4} enum_type1;
|
16
33
|
enum_type1 test_tagged_typedef_enum1(enum_type1 val) {
|
17
34
|
return val;
|
data/spec/ffi/function_spec.rb
CHANGED
@@ -64,10 +64,13 @@ describe FFI::Function do
|
|
64
64
|
|
65
65
|
it 'can wrap a blocking function' do
|
66
66
|
fp = FFI::Function.new(:void, [ :int ], @libtest.find_function('testBlocking'), :blocking => true)
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
threads = 10.times.map do |x|
|
68
|
+
Thread.new do
|
69
|
+
time = Time.now
|
70
|
+
fp.call(2)
|
71
|
+
expect(Time.now - time).to be >= 2
|
72
|
+
end
|
73
|
+
end
|
71
74
|
threads.each { |t| t.join }
|
72
75
|
end
|
73
76
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wayne Meissner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -418,6 +418,7 @@ files:
|
|
418
418
|
- lib/ffi/managedstruct.rb
|
419
419
|
- lib/ffi/memorypointer.rb
|
420
420
|
- lib/ffi/platform.rb
|
421
|
+
- lib/ffi/platform/aarch64-linux/types.conf
|
421
422
|
- lib/ffi/platform/arm-linux/types.conf
|
422
423
|
- lib/ffi/platform/i386-cygwin/types.conf
|
423
424
|
- lib/ffi/platform/i386-darwin/types.conf
|
@@ -430,10 +431,12 @@ files:
|
|
430
431
|
- lib/ffi/platform/i386-windows/types.conf
|
431
432
|
- lib/ffi/platform/ia64-linux/types.conf
|
432
433
|
- lib/ffi/platform/mips-linux/types.conf
|
434
|
+
- lib/ffi/platform/mips64el-linux/types.conf
|
433
435
|
- lib/ffi/platform/mipsel-linux/types.conf
|
434
436
|
- lib/ffi/platform/powerpc-aix/types.conf
|
435
437
|
- lib/ffi/platform/powerpc-darwin/types.conf
|
436
438
|
- lib/ffi/platform/powerpc-linux/types.conf
|
439
|
+
- lib/ffi/platform/powerpc64-linux/types.conf
|
437
440
|
- lib/ffi/platform/s390-linux/types.conf
|
438
441
|
- lib/ffi/platform/s390x-linux/types.conf
|
439
442
|
- lib/ffi/platform/sparc-linux/types.conf
|
@@ -487,36 +490,21 @@ files:
|
|
487
490
|
- spec/ffi/errno_spec.rb
|
488
491
|
- spec/ffi/ffi_spec.rb
|
489
492
|
- spec/ffi/fixtures/Benchmark.c
|
490
|
-
- spec/ffi/fixtures/Benchmark.o
|
491
493
|
- spec/ffi/fixtures/BoolTest.c
|
492
|
-
- spec/ffi/fixtures/BoolTest.o
|
493
494
|
- spec/ffi/fixtures/BufferTest.c
|
494
|
-
- spec/ffi/fixtures/BufferTest.o
|
495
495
|
- spec/ffi/fixtures/ClosureTest.c
|
496
|
-
- spec/ffi/fixtures/ClosureTest.o
|
497
496
|
- spec/ffi/fixtures/EnumTest.c
|
498
|
-
- spec/ffi/fixtures/EnumTest.o
|
499
497
|
- spec/ffi/fixtures/FunctionTest.c
|
500
|
-
- spec/ffi/fixtures/FunctionTest.o
|
501
498
|
- spec/ffi/fixtures/GNUmakefile
|
502
499
|
- spec/ffi/fixtures/GlobalVariable.c
|
503
|
-
- spec/ffi/fixtures/GlobalVariable.o
|
504
500
|
- spec/ffi/fixtures/LastErrorTest.c
|
505
|
-
- spec/ffi/fixtures/LastErrorTest.o
|
506
501
|
- spec/ffi/fixtures/NumberTest.c
|
507
|
-
- spec/ffi/fixtures/NumberTest.o
|
508
502
|
- spec/ffi/fixtures/PointerTest.c
|
509
|
-
- spec/ffi/fixtures/PointerTest.o
|
510
503
|
- spec/ffi/fixtures/ReferenceTest.c
|
511
|
-
- spec/ffi/fixtures/ReferenceTest.o
|
512
504
|
- spec/ffi/fixtures/StringTest.c
|
513
|
-
- spec/ffi/fixtures/StringTest.o
|
514
505
|
- spec/ffi/fixtures/StructTest.c
|
515
|
-
- spec/ffi/fixtures/StructTest.o
|
516
506
|
- spec/ffi/fixtures/UnionTest.c
|
517
|
-
- spec/ffi/fixtures/UnionTest.o
|
518
507
|
- spec/ffi/fixtures/VariadicTest.c
|
519
|
-
- spec/ffi/fixtures/VariadicTest.o
|
520
508
|
- spec/ffi/fixtures/classes.rb
|
521
509
|
- spec/ffi/function_spec.rb
|
522
510
|
- spec/ffi/io_spec.rb
|
@@ -565,7 +553,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
565
553
|
version: '0'
|
566
554
|
requirements: []
|
567
555
|
rubyforge_project:
|
568
|
-
rubygems_version: 2.
|
556
|
+
rubygems_version: 2.4.6
|
569
557
|
signing_key:
|
570
558
|
specification_version: 4
|
571
559
|
summary: Ruby FFI
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|