mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
43c0b50cbd
Returns an Array of Addrinfo objects for all local IP addresses (IPv4 and IPv6) on every network interface, matching CRuby's API. Backed by getifaddrs(3) on POSIX and GetAdaptersAddresses on Windows (requires iphlpapi.lib, added to the Windows linker libs). The HAL returns binary sockaddr strings; src/socket.c wraps each into Addrinfo so the wrapping code stays platform-agnostic. Resolves the second error reported in #5659 (after the IO.select fix from the HAL split): "undefined method 'ip_address_list' for Class". Issue #5659 itself is closed; this lands the missing API. Ref #5659. Co-authored-by: Claude <noreply@anthropic.com>
18 lines
591 B
Ruby
18 lines
591 B
Ruby
MRuby::Gem::Specification.new('mruby-socket') do |spec|
|
|
spec.license = 'MIT'
|
|
spec.authors = ['Internet Initiative Japan Inc.', 'mruby developers']
|
|
spec.summary = 'standard socket class'
|
|
|
|
#spec.cc.defines << "HAVE_SA_LEN=0"
|
|
|
|
spec.add_dependency('mruby-io', :core => 'mruby-io')
|
|
spec.add_dependency('mruby-error', :core => 'mruby-error')
|
|
# spec.add_dependency('mruby-mtest')
|
|
|
|
if spec.for_windows?
|
|
spec.linker.libraries << "wsock32"
|
|
spec.linker.libraries << "ws2_32"
|
|
spec.linker.libraries << "iphlpapi" # for GetAdaptersAddresses (Socket.ip_address_list)
|
|
end
|
|
end
|