Sha256: 98c0ae5c223927df8a514b6cb14f53fde760f2e5db127cc4ba2a6236f94d5172

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

require 'mkmf'

have_header("ruby/st.h")
have_header("st.h")
have_func("rb_enc_interned_str", "ruby.h") # Ruby 3.0+
have_func("rb_hash_new_capa", "ruby.h") # Ruby 3.2+

$CFLAGS << " -fvisibility=hidden "

unless RUBY_PLATFORM.include? 'mswin'
  $CFLAGS << %[ -I.. -Wall -O3 #{RbConfig::CONFIG["debugflags"]} -std=gnu99]
end

if RUBY_VERSION.start_with?('3.0.') && RUBY_VERSION <= '3.0.5'
  # https://bugs.ruby-lang.org/issues/18772
  $CFLAGS << ' -DRB_ENC_INTERNED_STR_NULL_CHECK=1 '
end

# checking if Hash#[]= (rb_hash_aset) dedupes string keys (Ruby 2.6+)
h = {}
x = {}
r = rand.to_s
h[%W(#{r}).join('')] = :foo
x[%W(#{r}).join('')] = :foo
if x.keys[0].equal?(h.keys[0])
  $CFLAGS << ' -DHASH_ASET_DEDUPE=1 '
else
  $CFLAGS << ' -DHASH_ASET_DEDUPE=0 '
end

# checking if String#-@ (str_uminus) directly interns frozen strings... ' (Ruby 3.0+)
begin
  s = rand.to_s.freeze
  if (-s).equal?(s) && (-s.dup).equal?(s)
    $CFLAGS << ' -DSTR_UMINUS_DEDUPE_FROZEN=1 '
  else
    $CFLAGS << ' -DSTR_UMINUS_DEDUPE_FROZEN=0 '
  end
rescue NoMethodError
  $CFLAGS << ' -DSTR_UMINUS_DEDUPE_FROZEN=0 '
end

if warnflags = CONFIG['warnflags']
  warnflags.slice!(/ -Wdeclaration-after-statement/)
end

create_makefile('msgpack/msgpack')

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/msgpack-1.7.0/ext/msgpack/extconf.rb
msgpack-1.7.0 ext/msgpack/extconf.rb