require 'mkmf' dir_config('atomic_ops') have_func('mmap', 'sys/mman.h') or abort 'mmap() not found' have_func('munmap', 'sys/mman.h') or abort 'munmap() not found' $CPPFLAGS += " -D_GNU_SOURCE " have_func('mremap', 'sys/mman.h') $CPPFLAGS += " -D_BSD_SOURCE " have_func("getpagesize", "unistd.h") have_func('rb_thread_blocking_region') have_func('rb_thread_io_blocking_region') checking_for "GCC 4+ atomic builtins" do # we test CMPXCHG anyways even though we don't need it to filter out # ancient i386-only targets without CMPXCHG src = <