Skip to content

Commit

Permalink
Disable OCI8.properties[:tcp_keepalive_time] feature on macOS arm64
Browse files Browse the repository at this point in the history
It doesn't work on macOS arm64. (#257)
  • Loading branch information
kubo committed Jun 25, 2024
1 parent a2ababb commit 8e67b9b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/hanging-after-inactivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ by the `tcp_keepalive_time` property.
It is supported on the following platforms since ruby-oci8 2.2.4.

* Linux i386 and x86_64
* macOS
* macOS x86_64
* Windows x86 and x64
* Solaris x86_64

Expand Down
31 changes: 19 additions & 12 deletions ext/oci8/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,22 +150,29 @@ def fmt.%(x)
case RUBY_PLATFORM
when /mswin32|cygwin|mingw/
plthook_src = "plthook_win32.c"
when /darwin/
when /x86_64-darwin/
plthook_src = "plthook_osx.c"
when /darwin/
# macOS arm64
plthook_src = nil
puts "skip"
else
plthook_src = "plthook_elf.c"
end
FileUtils.copy(File.dirname(__FILE__) + "/" + plthook_src, CONFTEST_C)
if xsystem(cc_command(""))
FileUtils.rm_f("#{CONFTEST}.#{$OBJEXT}")
puts plthook_src
$objs << plthook_src.gsub(/\.c$/, '.o')
$objs << "hook_funcs.o"
$defs << "-DHAVE_PLTHOOK"
have_library('dbghelp', 'ImageDirectoryEntryToData', ['windows.h', 'dbghelp.h']) if RUBY_PLATFORM =~ /cygwin/
$libs += ' -lws2_32' if RUBY_PLATFORM =~ /cygwin/
else
puts "no"

if plthook_src
FileUtils.copy(File.dirname(__FILE__) + "/" + plthook_src, CONFTEST_C)
if xsystem(cc_command(""))
FileUtils.rm_f("#{CONFTEST}.#{$OBJEXT}")
puts plthook_src
$objs << plthook_src.gsub(/\.c$/, '.o')
$objs << "hook_funcs.o"
$defs << "-DHAVE_PLTHOOK"
have_library('dbghelp', 'ImageDirectoryEntryToData', ['windows.h', 'dbghelp.h']) if RUBY_PLATFORM =~ /cygwin/
$libs += ' -lws2_32' if RUBY_PLATFORM =~ /cygwin/
else
puts "no"
end
end

$defs << "-DInit_oci8lib=Init_#{so_basename}"
Expand Down

0 comments on commit 8e67b9b

Please sign in to comment.