ffi 1.0.4 → 1.0.5

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.

Files changed (60) hide show
  1. data/Rakefile +2 -2
  2. data/ext/ffi_c/AbstractMemory.c +1 -1
  3. data/ext/ffi_c/ArrayType.c +11 -19
  4. data/ext/ffi_c/ArrayType.h +11 -19
  5. data/ext/ffi_c/Buffer.c +2 -0
  6. data/ext/ffi_c/Call.h +12 -19
  7. data/ext/ffi_c/ClosurePool.h +19 -0
  8. data/ext/ffi_c/DynamicLibrary.h +18 -0
  9. data/ext/ffi_c/Function.c +12 -13
  10. data/ext/ffi_c/Function.h +12 -19
  11. data/ext/ffi_c/LastError.c +12 -19
  12. data/ext/ffi_c/LastError.h +20 -0
  13. data/ext/ffi_c/MappedType.c +12 -19
  14. data/ext/ffi_c/MappedType.h +12 -19
  15. data/ext/ffi_c/MemoryPointer.c +1 -0
  16. data/ext/ffi_c/MemoryPointer.h +23 -3
  17. data/ext/ffi_c/MethodHandle.h +15 -22
  18. data/ext/ffi_c/Platform.c +36 -9
  19. data/ext/ffi_c/Platform.h +23 -3
  20. data/ext/ffi_c/Pointer.c +2 -0
  21. data/ext/ffi_c/Pointer.h +11 -19
  22. data/ext/ffi_c/Struct.c +12 -19
  23. data/ext/ffi_c/Struct.h +11 -19
  24. data/ext/ffi_c/StructByValue.c +13 -19
  25. data/ext/ffi_c/StructByValue.h +12 -19
  26. data/ext/ffi_c/StructLayout.c +12 -19
  27. data/ext/ffi_c/Thread.c +36 -10
  28. data/ext/ffi_c/Thread.h +14 -5
  29. data/ext/ffi_c/Type.c +1 -0
  30. data/ext/ffi_c/Types.c +12 -19
  31. data/ext/ffi_c/Types.h +11 -19
  32. data/ext/ffi_c/Variadic.c +1 -1
  33. data/ext/ffi_c/compat.h +13 -19
  34. data/ext/ffi_c/endian.h +1 -0
  35. data/ext/ffi_c/extconf.rb +3 -1
  36. data/ext/ffi_c/ffi.c +12 -19
  37. data/ext/ffi_c/rbffi.h +23 -3
  38. data/lib/ffi/tools/const_generator.rb +1 -1
  39. data/spec/ffi/async_callback_spec.rb +35 -12
  40. data/spec/ffi/bool_spec.rb +16 -0
  41. data/spec/ffi/buffer_spec.rb +34 -21
  42. data/spec/ffi/callback_spec.rb +16 -0
  43. data/spec/ffi/custom_param_type.rb +16 -0
  44. data/spec/ffi/custom_type_spec.rb +16 -0
  45. data/spec/ffi/enum_spec.rb +16 -0
  46. data/spec/ffi/errno_spec.rb +16 -0
  47. data/spec/ffi/ffi_spec.rb +16 -0
  48. data/spec/ffi/library_spec.rb +16 -0
  49. data/spec/ffi/managed_struct_spec.rb +16 -0
  50. data/spec/ffi/number_spec.rb +16 -0
  51. data/spec/ffi/strptr_spec.rb +16 -0
  52. data/spec/ffi/struct_callback_spec.rb +16 -0
  53. data/spec/ffi/struct_initialize_spec.rb +1 -0
  54. data/spec/ffi/struct_packed_spec.rb +16 -0
  55. data/spec/ffi/struct_spec.rb +16 -0
  56. data/spec/ffi/typedef_spec.rb +16 -0
  57. data/spec/ffi/union_spec.rb +16 -0
  58. data/spec/ffi/variadic_spec.rb +16 -0
  59. data/tasks/extension.rake +1 -1
  60. metadata +9 -38
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ 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.9.2'
8
+ ENV['RUBY_CC_VERSION'] = '1.8.7:1.9.2'
9
9
  end
10
10
 
11
11
  require 'date'
@@ -75,7 +75,7 @@ PROJ.name = 'ffi'
75
75
  PROJ.authors = 'Wayne Meissner'
76
76
  PROJ.email = 'wmeissner@gmail.com'
77
77
  PROJ.url = 'http://wiki.github.com/ffi/ffi'
78
- PROJ.version = '1.0.4'
78
+ PROJ.version = '1.0.5'
79
79
  PROJ.rubyforge.name = 'ffi'
80
80
  PROJ.readme_file = 'README.rdoc'
81
81
 
@@ -165,7 +165,7 @@ SWAPU16(uint16_t x)
165
165
  return bswap16(x);
166
166
  }
167
167
 
168
- #if __GNUC__ < 4
168
+ #if !defined(__GNUC__) || __GNUC__ < 4
169
169
  #define bswap32(x) \
170
170
  (((x << 24) & 0xff000000) | \
171
171
  ((x << 8) & 0x00ff0000) | \
@@ -3,27 +3,19 @@
3
3
  *
4
4
  * All rights reserved.
5
5
  *
6
- * Redistribution and use in source and binary forms, with or without
7
- * modification, are permitted provided that the following conditions are met:
6
+ * This file is part of ruby-ffi.
8
7
  *
9
- * * Redistributions of source code must retain the above copyright notice, this
10
- * list of conditions and the following disclaimer.
11
- * * Redistributions in binary form must reproduce the above copyright notice
12
- * this list of conditions and the following disclaimer in the documentation
13
- * and/or other materials provided with the distribution.
14
- * * The name of the author or authors may not be used to endorse or promote
15
- * products derived from this software without specific prior written permission.
8
+ * This code is free software: you can redistribute it and/or modify it under
9
+ * the terms of the GNU Lesser General Public License version 3 only, as
10
+ * published by the Free Software Foundation.
16
11
  *
17
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
21
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12
+ * This code is distributed in the hope that it will be useful, but WITHOUT
13
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15
+ * version 3 for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
27
19
  */
28
20
 
29
21
  #include <ruby.h>
@@ -3,27 +3,19 @@
3
3
  *
4
4
  * All rights reserved.
5
5
  *
6
- * Redistribution and use in source and binary forms, with or without
7
- * modification, are permitted provided that the following conditions are met:
6
+ * This file is part of ruby-ffi.
8
7
  *
9
- * * Redistributions of source code must retain the above copyright notice, this
10
- * list of conditions and the following disclaimer.
11
- * * Redistributions in binary form must reproduce the above copyright notice
12
- * this list of conditions and the following disclaimer in the documentation
13
- * and/or other materials provided with the distribution.
14
- * * The name of the author or authors may not be used to endorse or promote
15
- * products derived from this software without specific prior written permission.
8
+ * This code is free software: you can redistribute it and/or modify it under
9
+ * the terms of the GNU Lesser General Public License version 3 only, as
10
+ * published by the Free Software Foundation.
16
11
  *
17
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
21
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12
+ * This code is distributed in the hope that it will be useful, but WITHOUT
13
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15
+ * version 3 for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
27
19
  */
28
20
 
29
21
  #ifndef RBFFI_ARRAYTYPE_H
@@ -23,6 +23,7 @@
23
23
  #include <limits.h>
24
24
  #include <ruby.h>
25
25
  #include "rbffi.h"
26
+ #include "endian.h"
26
27
  #include "AbstractMemory.h"
27
28
 
28
29
  typedef struct Buffer {
@@ -240,3 +241,4 @@ rbffi_Buffer_Init(VALUE moduleFFI)
240
241
  rb_define_method(BufferClass, "+", buffer_plus, 1);
241
242
  rb_define_method(BufferClass, "slice", buffer_slice, 2);
242
243
  }
244
+
@@ -3,29 +3,22 @@
3
3
  * Copyright (c) 2009, Luc Heinrich <luc@honk-honk.com>
4
4
  * Copyright (c) 2009, Mike Dalessio <mike.dalessio@gmail.com>
5
5
  * Copyright (c) 2009, Aman Gupta.
6
+ *
6
7
  * All rights reserved.
7
8
  *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions are met:
9
+ * This file is part of ruby-ffi.
10
+ *
11
+ * This code is free software: you can redistribute it and/or modify it under
12
+ * the terms of the GNU Lesser General Public License version 3 only, as
13
+ * published by the Free Software Foundation.
10
14
  *
11
- * * Redistributions of source code must retain the above copyright notice, this
12
- * list of conditions and the following disclaimer.
13
- * * Redistributions in binary form must reproduce the above copyright notice
14
- * this list of conditions and the following disclaimer in the documentation
15
- * and/or other materials provided with the distribution.
16
- * * The name of the author or authors may not be used to endorse or promote
17
- * products derived from this software without specific prior written permission.
15
+ * This code is distributed in the hope that it will be useful, but WITHOUT
16
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
18
+ * version 3 for more details.
18
19
  *
19
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
23
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20
+ * You should have received a copy of the GNU Lesser General Public License
21
+ * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
29
22
  */
30
23
 
31
24
  #ifndef RBFFI_INVOKE_H
@@ -1,3 +1,22 @@
1
+ /*
2
+ * Copyright (c) 2009, 2010 Wayne Meissner
3
+ * All rights reserved.
4
+ *
5
+ * This file is part of ruby-ffi.
6
+ *
7
+ * This code is free software: you can redistribute it and/or modify it under
8
+ * the terms of the GNU Lesser General Public License version 3 only, as
9
+ * published by the Free Software Foundation.
10
+ *
11
+ * This code is distributed in the hope that it will be useful, but WITHOUT
12
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14
+ * version 3 for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public License
17
+ * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+
1
20
  #ifndef RUBYFFI_CLOSUREPOOL_H
2
21
  #define RUBYFFI_CLOSUREPOOL_H
3
22
 
@@ -1,3 +1,21 @@
1
+ /*
2
+ * Copyright (c) 2008-2010 Wayne Meissner
3
+ * All rights reserved.
4
+ *
5
+ * This file is part of ruby-ffi.
6
+ *
7
+ * This code is free software: you can redistribute it and/or modify it under
8
+ * the terms of the GNU Lesser General Public License version 3 only, as
9
+ * published by the Free Software Foundation.
10
+ *
11
+ * This code is distributed in the hope that it will be useful, but WITHOUT
12
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14
+ * version 3 for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public License
17
+ * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
18
+ */
1
19
 
2
20
  #ifndef _LIBRARY_H
3
21
  #define _LIBRARY_H
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2009, 2010 Wayne Meissner
3
-
2
+ * Copyright (c) 2009-2011 Wayne Meissner
3
+ *
4
4
  * All rights reserved.
5
5
  *
6
6
  * This file is part of ruby-ffi.
@@ -69,17 +69,16 @@ static void callback_invoke(ffi_cif* cif, void* retval, void** parameters, void*
69
69
  static bool callback_prep(void* ctx, void* code, Closure* closure, char* errmsg, size_t errmsgsize);
70
70
  static void* callback_with_gvl(void* data);
71
71
 
72
- #define DEFER_ASYNC_CALLBACK 1
72
+ #if !defined(_WIN32) || defined(HAVE_RB_THREAD_BLOCKING_REGION)
73
+ # define DEFER_ASYNC_CALLBACK 1
74
+ #endif
75
+
73
76
 
74
77
  #if defined(DEFER_ASYNC_CALLBACK)
75
78
  static VALUE async_cb_event(void *);
76
79
  static VALUE async_cb_call(void *);
77
80
  #endif
78
81
 
79
- #ifdef HAVE_RUBY_THREAD_HAS_GVL_P
80
- extern int ruby_thread_has_gvl_p(void);
81
- #endif
82
-
83
82
  #ifdef HAVE_RB_THREAD_CALL_WITH_GVL
84
83
  extern void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
85
84
  #endif
@@ -268,12 +267,12 @@ function_init(VALUE self, VALUE rbFunctionInfo, VALUE rbProc)
268
267
  }
269
268
 
270
269
  #if defined(DEFER_ASYNC_CALLBACK)
271
- # if !defined(HAVE_RB_THREAD_BLOCKING_REGION)
272
- pipe(async_cb_pipe);
273
- fcntl(async_cb_pipe[0], F_SETFL, fcntl(async_cb_pipe[0], F_GETFL) | O_NONBLOCK);
274
- fcntl(async_cb_pipe[1], F_SETFL, fcntl(async_cb_pipe[1], F_GETFL) | O_NONBLOCK);
275
- # endif
276
270
  if (async_cb_thread == Qnil) {
271
+ #if !defined(HAVE_RB_THREAD_BLOCKING_REGION)
272
+ pipe(async_cb_pipe);
273
+ fcntl(async_cb_pipe[0], F_SETFL, fcntl(async_cb_pipe[0], F_GETFL) | O_NONBLOCK);
274
+ fcntl(async_cb_pipe[1], F_SETFL, fcntl(async_cb_pipe[1], F_GETFL) | O_NONBLOCK);
275
+ #endif
277
276
  async_cb_thread = rb_thread_create(async_cb_event, NULL);
278
277
  }
279
278
 
@@ -832,7 +831,7 @@ rbffi_Function_Init(VALUE moduleFFI)
832
831
  id_cb_ref = rb_intern("@__ffi_callback__");
833
832
  id_to_native = rb_intern("to_native");
834
833
  id_from_native = rb_intern("from_native");
835
- #ifdef _WIN32
834
+ #if defined(_WIN32) && defined(HAVE_RB_THREAD_BLOCKING_REGION)
836
835
  InitializeCriticalSection(&async_cb_lock);
837
836
  async_cb_cond = CreateEvent(NULL, FALSE, FALSE, NULL);
838
837
  #endif
@@ -1,28 +1,21 @@
1
1
  /*
2
2
  * Copyright (c) 2009, Wayne Meissner
3
+ *
3
4
  * All rights reserved.
4
5
  *
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions are met:
6
+ * This file is part of ruby-ffi.
7
+ *
8
+ * This code is free software: you can redistribute it and/or modify it under
9
+ * the terms of the GNU Lesser General Public License version 3 only, as
10
+ * published by the Free Software Foundation.
7
11
  *
8
- * * Redistributions of source code must retain the above copyright notice, this
9
- * list of conditions and the following disclaimer.
10
- * * Redistributions in binary form must reproduce the above copyright notice
11
- * this list of conditions and the following disclaimer in the documentation
12
- * and/or other materials provided with the distribution.
13
- * * The name of the author or authors may not be used to endorse or promote
14
- * products derived from this software without specific prior written permission.
12
+ * This code is distributed in the hope that it will be useful, but WITHOUT
13
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15
+ * version 3 for more details.
15
16
  *
16
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
20
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
26
19
  */
27
20
 
28
21
  #ifndef RBFFI_FUNCTION_H
@@ -3,27 +3,19 @@
3
3
  *
4
4
  * All rights reserved.
5
5
  *
6
- * Redistribution and use in source and binary forms, with or without
7
- * modification, are permitted provided that the following conditions are met:
6
+ * This file is part of ruby-ffi.
8
7
  *
9
- * * Redistributions of source code must retain the above copyright notice, this
10
- * list of conditions and the following disclaimer.
11
- * * Redistributions in binary form must reproduce the above copyright notice
12
- * this list of conditions and the following disclaimer in the documentation
13
- * and/or other materials provided with the distribution.
14
- * * The name of the author or authors may not be used to endorse or promote
15
- * products derived from this software without specific prior written permission.
8
+ * This code is free software: you can redistribute it and/or modify it under
9
+ * the terms of the GNU Lesser General Public License version 3 only, as
10
+ * published by the Free Software Foundation.
16
11
  *
17
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
21
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12
+ * This code is distributed in the hope that it will be useful, but WITHOUT
13
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15
+ * version 3 for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
27
19
  */
28
20
 
29
21
  #include <sys/param.h>
@@ -157,3 +149,4 @@ rbffi_LastError_Init(VALUE moduleFFI)
157
149
  id_thread_data = rb_intern("ffi_thread_local_data");
158
150
  #endif /* USE_PTHREAD_LOCAL */
159
151
  }
152
+
@@ -1,3 +1,23 @@
1
+ /*
2
+ * Copyright (c) 2008, 2009, Wayne Meissner
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This file is part of ruby-ffi.
7
+ *
8
+ * This code is free software: you can redistribute it and/or modify it under
9
+ * the terms of the GNU Lesser General Public License version 3 only, as
10
+ * published by the Free Software Foundation.
11
+ *
12
+ * This code is distributed in the hope that it will be useful, but WITHOUT
13
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15
+ * version 3 for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+
1
21
  #ifndef RBFFI_LASTERROR_H
2
22
  #define RBFFI_LASTERROR_H
3
23
 
@@ -1,28 +1,21 @@
1
1
  /*
2
2
  * Copyright (c) 2010, Wayne Meissner
3
+ *
3
4
  * All rights reserved.
4
5
  *
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions are met:
6
+ * This file is part of ruby-ffi.
7
+ *
8
+ * This code is free software: you can redistribute it and/or modify it under
9
+ * the terms of the GNU Lesser General Public License version 3 only, as
10
+ * published by the Free Software Foundation.
7
11
  *
8
- * * Redistributions of source code must retain the above copyright notice, this
9
- * list of conditions and the following disclaimer.
10
- * * Redistributions in binary form must reproduce the above copyright notice
11
- * this list of conditions and the following disclaimer in the documentation
12
- * and/or other materials provided with the distribution.
13
- * * The name of the author or authors may not be used to endorse or promote
14
- * products derived from this software without specific prior written permission.
12
+ * This code is distributed in the hope that it will be useful, but WITHOUT
13
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15
+ * version 3 for more details.
15
16
  *
16
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
20
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
26
19
  */
27
20
 
28
21
  #include <ruby.h>
@@ -1,28 +1,21 @@
1
1
  /*
2
2
  * Copyright (c) 2010, Wayne Meissner
3
+ *
3
4
  * All rights reserved.
4
5
  *
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions are met:
6
+ * This file is part of ruby-ffi.
7
+ *
8
+ * This code is free software: you can redistribute it and/or modify it under
9
+ * the terms of the GNU Lesser General Public License version 3 only, as
10
+ * published by the Free Software Foundation.
7
11
  *
8
- * * Redistributions of source code must retain the above copyright notice, this
9
- * list of conditions and the following disclaimer.
10
- * * Redistributions in binary form must reproduce the above copyright notice
11
- * this list of conditions and the following disclaimer in the documentation
12
- * and/or other materials provided with the distribution.
13
- * * The name of the author or authors may not be used to endorse or promote
14
- * products derived from this software without specific prior written permission.
12
+ * This code is distributed in the hope that it will be useful, but WITHOUT
13
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15
+ * version 3 for more details.
15
16
  *
16
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
20
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
26
19
  */
27
20
 
28
21
  #ifndef RBFFI_MAPPEDTYPE_H