From 94bc4406455923acecb532714c9643cf9940722c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 15 Dec 2018 22:29:29 +0000 Subject: extconf: fix rb_hash_aset deduplication test We must rely on a random string which is already outside of the Ruby fstring table. --- ext/kcar/extconf.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/kcar/extconf.rb b/ext/kcar/extconf.rb index ba69c3c..1608f70 100644 --- a/ext/kcar/extconf.rb +++ b/ext/kcar/extconf.rb @@ -24,8 +24,11 @@ end message('checking if Hash#[]= (rb_hash_aset) dedupes... ') h = {} -h[%w(m k m f).join('')] = :foo -if 'mkmf'.freeze.equal?(h.keys[0]) +x = {} +r = rand.to_s +h[%W(#{r}).join('')] = :foo +x[%W(#{r}).join('')] = :foo +if x.keys[0].equal?(h.keys[0]) $CPPFLAGS += ' -DHASH_ASET_DEDUPE=1 ' message("yes\n") else -- cgit v1.2.3-24-ge0c7