From 7f24b0aabd4e1f6d0ff058a944508575a08eaa65 Mon Sep 17 00:00:00 2001 From: hsbt Date: Tue, 12 Sep 2017 11:52:23 +0000 Subject: Merge fiddle-1.0.0.beta2 from upstream. * 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/closure.c | 3 ++- ext/fiddle/extconf.rb | 8 ++++---- ext/fiddle/fiddle.gemspec | 5 ++--- ext/fiddle/lib/fiddle.rb | 2 +- ext/fiddle/lib/fiddle/closure.rb | 2 +- ext/fiddle/lib/fiddle/cparser.rb | 2 +- ext/fiddle/lib/fiddle/function.rb | 2 +- ext/fiddle/lib/fiddle/import.rb | 2 +- ext/fiddle/lib/fiddle/pack.rb | 4 ++-- ext/fiddle/lib/fiddle/struct.rb | 2 +- ext/fiddle/lib/fiddle/types.rb | 2 +- ext/fiddle/lib/fiddle/value.rb | 2 +- ext/fiddle/win32/libffi-config.rb | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) (limited to 'ext') diff --git a/ext/fiddle/closure.c b/ext/fiddle/closure.c index f19091b29b..1a80b2b02a 100644 --- a/ext/fiddle/closure.c +++ b/ext/fiddle/closure.c @@ -1,6 +1,7 @@ #include #include -#include "internal.h" /* rb_thread_has_gvl_p */ + +int ruby_thread_has_gvl_p(void); /* from internal.h */ VALUE cFiddleClosure; diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb index 9e244ed27d..2c333001e5 100644 --- a/ext/fiddle/extconf.rb +++ b/ext/fiddle/extconf.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'mkmf' # :stopdoc: @@ -41,12 +41,12 @@ begin libffi.lib = "#{libffi.builddir}/.libs" libffi.a = "#{libffi.lib}/libffi_convenience.#{$LIBEXT}" nowarn = CONFIG.merge("warnflags"=>"") - libffi.cflags = RbConfig.expand("$(CFLAGS)", nowarn) + libffi.cflags = RbConfig.expand("$(CFLAGS)".dup, nowarn) ver = ver[/libffi-(.*)/, 1] FileUtils.mkdir_p(libffi.dir) libffi.opt = CONFIG['configure_args'][/'(-C)'/, 1] - libffi.ldflags = RbConfig.expand("$(LDFLAGS) #{libpathflag([relative_from($topdir, "..")])} #{$LIBRUBYARG}") + libffi.ldflags = RbConfig.expand("$(LDFLAGS) #{libpathflag([relative_from($topdir, "..")])} #{$LIBRUBYARG}".dup) libffi.arch = RbConfig::CONFIG['host'] if $mswin unless find_executable(as = /x64/ =~ libffi.arch ? "ml64" : "ml") @@ -77,7 +77,7 @@ begin args << libffi.opt if libffi.opt args.concat %W[ CC=#{cc} CFLAGS=#{libffi.cflags} - CXX=#{cxx} CXXFLAGS=#{RbConfig.expand("$(CXXFLAGS)", nowarn)} + CXX=#{cxx} CXXFLAGS=#{RbConfig.expand("$(CXXFLAGS)".dup, nowarn)} LD=#{ld} LDFLAGS=#{libffi.ldflags} ] diff --git a/ext/fiddle/fiddle.gemspec b/ext/fiddle/fiddle.gemspec index 3e54f47f96..054d7c06ec 100644 --- a/ext/fiddle/fiddle.gemspec +++ b/ext/fiddle/fiddle.gemspec @@ -1,14 +1,14 @@ # frozen_string_literal: true Gem::Specification.new do |spec| spec.name = "fiddle" - spec.version = '1.0.0.beta1' + spec.version = '1.0.0.beta2' spec.authors = ["Aaron Patterson", "SHIBATA Hiroshi"] spec.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org"] spec.summary = %q{A libffi wrapper for Ruby.} spec.description = %q{A libffi wrapper for Ruby.} spec.homepage = "https://github.com/ruby/fiddle" - spec.license = "MIT" + spec.license = "BSD-2-Clause" spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "ext/fiddle/closure.c", "ext/fiddle/closure.h", "ext/fiddle/conversions.c", "ext/fiddle/conversions.h", "ext/fiddle/extconf.rb", "ext/fiddle/extlibs", "ext/fiddle/fiddle.c", "ext/fiddle/fiddle.h", "ext/fiddle/function.c", "ext/fiddle/function.h", "ext/fiddle/handle.c", "ext/fiddle/pointer.c", "ext/fiddle/win32/fficonfig.h", "ext/fiddle/win32/libffi-3.2.1-mswin.patch", "ext/fiddle/win32/libffi-config.rb", "ext/fiddle/win32/libffi.mk.tmpl", "fiddle.gemspec", "lib/fiddle.rb", "lib/fiddle/closure.rb", "lib/fiddle/cparser.rb", "lib/fiddle/function.rb", "lib/fiddle/import.rb", "lib/fiddle/pack.rb", "lib/fiddle/struct.rb", "lib/fiddle/types.rb", "lib/fiddle/value.rb"] spec.bindir = "exe" @@ -17,6 +17,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler" spec.add_development_dependency "rake" - spec.add_development_dependency "minitest", "~> 4.0" spec.add_development_dependency "rake-compiler" end diff --git a/ext/fiddle/lib/fiddle.rb b/ext/fiddle/lib/fiddle.rb index 5208eb9328..e9aa7e50ae 100644 --- a/ext/fiddle/lib/fiddle.rb +++ b/ext/fiddle/lib/fiddle.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'fiddle.so' require 'fiddle/function' require 'fiddle/closure' diff --git a/ext/fiddle/lib/fiddle/closure.rb b/ext/fiddle/lib/fiddle/closure.rb index 0b9adbb60a..c865a63c20 100644 --- a/ext/fiddle/lib/fiddle/closure.rb +++ b/ext/fiddle/lib/fiddle/closure.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Fiddle class Closure diff --git a/ext/fiddle/lib/fiddle/cparser.rb b/ext/fiddle/lib/fiddle/cparser.rb index 6b9da9fa7c..d3b450b85f 100644 --- a/ext/fiddle/lib/fiddle/cparser.rb +++ b/ext/fiddle/lib/fiddle/cparser.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Fiddle # A mixin that provides methods for parsing C struct and prototype signatures. # diff --git a/ext/fiddle/lib/fiddle/function.rb b/ext/fiddle/lib/fiddle/function.rb index fcd90dfd26..dd5e04e417 100644 --- a/ext/fiddle/lib/fiddle/function.rb +++ b/ext/fiddle/lib/fiddle/function.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Fiddle class Function # The ABI of the Function. diff --git a/ext/fiddle/lib/fiddle/import.rb b/ext/fiddle/lib/fiddle/import.rb index 09429f6631..59ab3ee6f7 100644 --- a/ext/fiddle/lib/fiddle/import.rb +++ b/ext/fiddle/lib/fiddle/import.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'fiddle' require 'fiddle/struct' require 'fiddle/cparser' diff --git a/ext/fiddle/lib/fiddle/pack.rb b/ext/fiddle/lib/fiddle/pack.rb index 6301068450..3c9e3c8ad7 100644 --- a/ext/fiddle/lib/fiddle/pack.rb +++ b/ext/fiddle/lib/fiddle/pack.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'fiddle' module Fiddle @@ -101,7 +101,7 @@ module Fiddle private def parse_types(types) - @template = "" + @template = "".dup addr = 0 types.each{|t| orig_addr = addr diff --git a/ext/fiddle/lib/fiddle/struct.rb b/ext/fiddle/lib/fiddle/struct.rb index 233a987269..7c0dedb39f 100644 --- a/ext/fiddle/lib/fiddle/struct.rb +++ b/ext/fiddle/lib/fiddle/struct.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'fiddle' require 'fiddle/value' require 'fiddle/pack' diff --git a/ext/fiddle/lib/fiddle/types.rb b/ext/fiddle/lib/fiddle/types.rb index 8a72635a69..8dc811d3e4 100644 --- a/ext/fiddle/lib/fiddle/types.rb +++ b/ext/fiddle/lib/fiddle/types.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Fiddle # Adds Windows type aliases to the including class for use with # Fiddle::Importer. diff --git a/ext/fiddle/lib/fiddle/value.rb b/ext/fiddle/lib/fiddle/value.rb index ac318cf2c4..a043b9b066 100644 --- a/ext/fiddle/lib/fiddle/value.rb +++ b/ext/fiddle/lib/fiddle/value.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'fiddle' module Fiddle diff --git a/ext/fiddle/win32/libffi-config.rb b/ext/fiddle/win32/libffi-config.rb index 7a32a91517..6abc9b2c02 100755 --- a/ext/fiddle/win32/libffi-config.rb +++ b/ext/fiddle/win32/libffi-config.rb @@ -1,5 +1,5 @@ #!/usr/bin/ruby -# frozen_string_literal: false +# frozen_string_literal: true require 'fileutils' basedir = File.dirname(__FILE__) -- cgit v1.2.1