ffi 1.2.0.dev2 → 1.2.0.dev3

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.

@@ -60,7 +60,6 @@ static VALUE
60
60
  mapped_initialize(VALUE self, VALUE rbConverter)
61
61
  {
62
62
  MappedType* m = NULL;
63
- Type* t = NULL;
64
63
 
65
64
  if (!rb_respond_to(rbConverter, id_native_type)) {
66
65
  rb_raise(rb_eNoMethodError, "native_type method not implemented");
@@ -38,7 +38,6 @@ typedef int bool;
38
38
 
39
39
 
40
40
  static VALUE memptr_allocate(VALUE klass);
41
- static void memptr_mark(Pointer* ptr);
42
41
  static void memptr_release(Pointer* ptr);
43
42
  static VALUE memptr_malloc(VALUE self, long size, long count, bool clear);
44
43
  static VALUE memptr_free(VALUE self);
@@ -137,12 +136,6 @@ memptr_release(Pointer* ptr)
137
136
  xfree(ptr);
138
137
  }
139
138
 
140
- static void
141
- memptr_mark(Pointer* ptr)
142
- {
143
- rb_gc_mark(ptr->rbParent);
144
- }
145
-
146
139
  static VALUE
147
140
  memptr_s_from_string(VALUE klass, VALUE to_str)
148
141
  {
@@ -330,7 +330,6 @@ trampoline_size(void)
330
330
  void
331
331
  rbffi_MethodHandle_Init(VALUE module)
332
332
  {
333
- ffi_status ffiStatus;
334
333
  defaultClosurePool = rbffi_ClosurePool_New((int) trampoline_size(), prep_trampoline, NULL);
335
334
 
336
335
  #if defined(CUSTOM_TRAMPOLINE)
@@ -432,7 +432,7 @@ struct_layout_union_bang(VALUE self)
432
432
  return Qnil;
433
433
  }
434
434
 
435
- count = (int) layout->size / t->size;
435
+ count = (int) layout->size / (int) t->size;
436
436
  xfree(layout->ffiTypes);
437
437
  layout->ffiTypes = xcalloc(count + 1, sizeof(ffi_type *));
438
438
  layout->base.ffiType->elements = layout->ffiTypes;
@@ -94,8 +94,7 @@ variadic_initialize(VALUE self, VALUE rbFunction, VALUE rbParameterTypes, VALUE
94
94
  VALUE retval = Qnil;
95
95
  VALUE convention = Qnil;
96
96
  VALUE fixed = Qnil;
97
- VALUE rbConventionStr;
98
- int i;
97
+ int i;
99
98
 
100
99
  Check_Type(options, T_HASH);
101
100
  convention = rb_hash_aref(options, ID2SYM(rb_intern("convention")));
@@ -4,7 +4,12 @@ if !defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby"
4
4
  require 'mkmf'
5
5
  require 'rbconfig'
6
6
  dir_config("ffi_c")
7
-
7
+
8
+ # recent versions of ruby add restrictive ansi and warning flags on a whim - kill them all
9
+ $warnflags = ''
10
+ $CFLAGS.gsub!(/-ansi/, '')
11
+ $CFLAGS.gsub!(/-std=[^\s]+/, '')
12
+
8
13
  if ENV['RUBY_CC_VERSION'].nil? && (pkg_config("libffi") ||
9
14
  have_header("ffi.h") ||
10
15
  find_header("ffi.h", "/usr/local/include", "/usr/include/ffi"))
@@ -31,11 +36,7 @@ if !defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby"
31
36
 
32
37
  $CFLAGS << " -mwin32 " if RbConfig::CONFIG['host_os'] =~ /cygwin/
33
38
  $LOCAL_LIBS << " ./libffi/.libs/libffi_convenience.lib" if RbConfig::CONFIG['host_os'] =~ /mswin/
34
- #$CFLAGS << " -Werror -Wunused -Wformat -Wimplicit -Wreturn-type "
35
- if (ENV['CC'] || RbConfig::MAKEFILE_CONFIG['CC']) =~ /gcc/
36
- # $CFLAGS << " -Wno-declaration-after-statement "
37
- end
38
-
39
+
39
40
  create_makefile("ffi_c")
40
41
  unless libffi_ok
41
42
  File.open("Makefile", "a") do |mf|
@@ -8,7 +8,16 @@
8
8
  #include <sys/types.h>
9
9
 
10
10
  #if defined(__linux__) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__)
11
- # include <endian.h>
11
+ # include <endian.h>
12
+ # if !defined(LITTLE_ENDIAN) && defined(__LITTLE_ENDIAN)
13
+ # define LITTLE_ENDIAN __LITTLE_ENDIAN
14
+ # endif
15
+ # if !defined(BIG_ENDIAN) && defined(__BIG_ENDIAN)
16
+ # define BIG_ENDIAN __BIG_ENDIAN
17
+ # endif
18
+ # if !defined(BYTE_ORDER) && defined(__BYTE_ORDER)
19
+ # define BYTE_ORDER __BYTE_ORDER
20
+ # endif
12
21
  #endif
13
22
 
14
23
  #ifdef __sun
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: -4076106022
4
+ hash: -235527788
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
9
  - 0
10
10
  - dev
11
- - 2
12
- version: 1.2.0.dev2
11
+ - 3
12
+ version: 1.2.0.dev3
13
13
  platform: ruby
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-08-12 00:00:00 +10:00
20
+ date: 2012-08-19 00:00:00 +10:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency