diff --git a/ext/bigdecimal/extconf.rb b/ext/bigdecimal/extconf.rb index 23904ed..cf4290f 100644 --- a/ext/bigdecimal/extconf.rb +++ b/ext/bigdecimal/extconf.rb @@ -24,15 +24,17 @@ def have_builtin_func(name, check_expr, opt = "", &b) have_header("stdbool.h") have_header("stdlib.h") -have_header("x86intrin.h") -have_func("_lzcnt_u32", "x86intrin.h") -have_func("_lzcnt_u64", "x86intrin.h") - -have_header("intrin.h") -have_func("__lzcnt", "intrin.h") -have_func("__lzcnt64", "intrin.h") -have_func("_BitScanReverse", "intrin.h") -have_func("_BitScanReverse64", "intrin.h") +if have_header("x86intrin.h") + have_func("_lzcnt_u32", "x86intrin.h") + have_func("_lzcnt_u64", "x86intrin.h") +end + +if have_header("intrin.h") + have_func("__lzcnt", "intrin.h") + have_func("__lzcnt64", "intrin.h") + have_func("_BitScanReverse", "intrin.h") + have_func("_BitScanReverse64", "intrin.h") +end have_func("labs", "stdlib.h") have_func("llabs", "stdlib.h")