about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-12-15 22:29:29 +0000
committerEric Wong <e@80x24.org>2018-12-15 22:30:34 +0000
commit94bc4406455923acecb532714c9643cf9940722c (patch)
tree7f6b8e6dcd90f27976c4fd8d1dca08fdcc8d4877
parent5ac452d36c2ecacb6398759db7439a5b8a64670e (diff)
downloadkcar-94bc4406455923acecb532714c9643cf9940722c.tar.gz
We must rely on a random string which is already outside
of the Ruby fstring table.
-rw-r--r--ext/kcar/extconf.rb7
1 files 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