Skip to content

Commit

Permalink
Added hostent structure
Browse files Browse the repository at this point in the history
This is required by gethostbyname() which in turn will be used by
rubysl-socket.
  • Loading branch information
Yorick Peterse committed Dec 4, 2015
1 parent fd97eb1 commit f6534b1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rakelib/platform.rake
Expand Up @@ -108,6 +108,17 @@ file 'runtime/platform.conf' => deps do |task|
sockaddr_un.write_config f if sockaddr_un.found?
end

Rubinius::FFI::Generators::Structures.new 'hostent' do |s|
s.include 'netdb.h'
s.name 'struct hostent'

s.field :h_name, :string
s.field :h_aliases, :pointer
s.field :h_addrtype, :int
s.field :h_length, :int
s.field :h_addr_list, :pointer
end.write_config(f)

Rubinius::FFI::Generators::Structures.new 'linger' do |s|
if BUILD_CONFIG[:windows]
s.include "winsock2.h"
Expand Down

0 comments on commit f6534b1

Please sign in to comment.