1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
hsbt 2017-09-12 11:52:23 +00:00
parent 29c1321a84
commit 7f24b0aabd
24 changed files with 33 additions and 33 deletions

View file

@ -1,6 +1,7 @@
#include <fiddle.h>
#include <ruby/thread.h>
#include "internal.h" /* rb_thread_has_gvl_p */
int ruby_thread_has_gvl_p(void); /* from internal.h */
VALUE cFiddleClosure;

View file

@ -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}
]

View file

@ -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

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'fiddle.so'
require 'fiddle/function'
require 'fiddle/closure'

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
module Fiddle
class Closure

View file

@ -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.
#

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
module Fiddle
class Function
# The ABI of the Function.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'fiddle'
require 'fiddle/struct'
require 'fiddle/cparser'

View file

@ -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

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'fiddle'
require 'fiddle/value'
require 'fiddle/pack'

View file

@ -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.

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'fiddle'
module Fiddle

View file

@ -1,5 +1,5 @@
#!/usr/bin/ruby
# frozen_string_literal: false
# frozen_string_literal: true
require 'fileutils'
basedir = File.dirname(__FILE__)

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require 'test/unit'
require 'fiddle'

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
begin
require_relative 'helper'
require 'fiddle/struct'

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
begin
require_relative 'helper'
require 'fiddle/struct'

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
begin
require_relative 'helper'
rescue LoadError

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
begin
require_relative 'helper'
require 'fiddle/cparser'

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
begin
require_relative 'helper'
rescue LoadError

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
begin
require_relative 'helper'
rescue LoadError
@ -16,7 +16,7 @@ module Fiddle
assert_raise(SecurityError) do
Thread.new {
$SAFE = 1
f.call("uname -rs".taint)
f.call("uname -rs".dup.taint)
}.join
end
end

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
begin
require_relative 'helper'
rescue LoadError

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
begin
require_relative 'helper'
rescue LoadError
@ -11,7 +11,7 @@ module Fiddle
def test_safe_handle_open
t = Thread.new do
$SAFE = 1
Fiddle::Handle.new(LIBC_SO.taint)
Fiddle::Handle.new(LIBC_SO.dup.taint)
end
assert_raise(SecurityError) { t.value }
end
@ -20,7 +20,7 @@ module Fiddle
t = Thread.new do
h = Fiddle::Handle.new(LIBC_SO)
$SAFE = 1
h["qsort".taint]
h["qsort".dup.taint]
end
assert_raise(SecurityError) { t.value }
end

View file

@ -1,5 +1,5 @@
# coding: US-ASCII
# frozen_string_literal: false
# frozen_string_literal: true
begin
require_relative 'helper'
require 'fiddle/import'

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
begin
require_relative 'helper'
rescue LoadError