1 # -*- encoding: binary -*-
2 # frozen_string_literal: false
5 have_func("rb_hash_clear", "ruby.h") or abort 'Ruby 2.0+ required'
7 message('checking if String#-@ (str_uminus) dedupes... ')
9 a = -(%w(t e s t).join)
10 b = -(%w(t e s t).join)
12 $CPPFLAGS += ' -DSTR_UMINUS_DEDUPE=1 '
15 $CPPFLAGS += ' -DSTR_UMINUS_DEDUPE=0 '
16 message("no, needs Ruby 2.5+\n")
19 $CPPFLAGS += ' -DSTR_UMINUS_DEDUPE=0 '
20 message("no, String#-@ not available\n")
23 message('checking if Hash#[]= (rb_hash_aset) dedupes... ')
27 h[%W(#{r}).join('')] = :foo
28 x[%W(#{r}).join('')] = :foo
29 if x.keys[0].equal?(h.keys[0])
30 $CPPFLAGS += ' -DHASH_ASET_DEDUPE=1 '
33 $CPPFLAGS += ' -DHASH_ASET_DEDUPE=0 '
34 message("no, needs Ruby 2.6+\n")
37 if have_func('epoll_create1', %w(sys/epoll.h))
38 have_func('rb_io_descriptor') # Ruby 3.1+
40 create_makefile("unicorn_http")