Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
fixed duplicate symbol definition
Browse files Browse the repository at this point in the history
  • Loading branch information
complexmath committed Aug 24, 2011
1 parent a59dd37 commit ab485ce
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 22 deletions.
10 changes: 8 additions & 2 deletions src/core/sys/posix/arpa/inet.d
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ extern (C):
// Required
//
/*
NOTE: The following must must be defined in core.sys.posix.arpa.inet to break
a circular import: in_port_t, in_addr_t, struct in_addr, INET_ADDRSTRLEN.
in_port_t // from core.sys.posix.netinet.in_
in_addr_t // from core.sys.posix.netinet.in_
Expand Down Expand Up @@ -69,8 +72,8 @@ version( linux )
}
else version( OSX )
{
alias uint16_t in_port_t; // TODO: verify
alias uint32_t in_addr_t; // TODO: verify
alias uint16_t in_port_t;
alias uint32_t in_addr_t;

struct in_addr
{
Expand Down Expand Up @@ -116,6 +119,9 @@ else version( FreeBSD )
// IPV6 (IP6)
//
/*
NOTE: The following must must be defined in core.sys.posix.arpa.inet to break
a circular import: INET6_ADDRSTRLEN.
INET6_ADDRSTRLEN // from core.sys.posix.netinet.in_
*/

Expand Down
63 changes: 43 additions & 20 deletions src/core/sys/posix/netinet/in_.d
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ ntohs() // from core.sys.posix.arpa.inet

version( linux )
{
//alias uint16_t in_port_t;
//alias uint32_t in_addr_t;

//struct in_addr
//{
// in_addr_t s_addr;
//}

private enum __SOCK_SIZE__ = 16;

struct sockaddr_in
Expand All @@ -89,10 +97,18 @@ version( linux )
enum uint INADDR_ANY = 0x00000000;
enum uint INADDR_BROADCAST = 0xffffffff;

enum INET_ADDRSTRLEN = 16;
//enum INET_ADDRSTRLEN = 16;
}
else version( OSX )
{
//alias uint16_t in_port_t;
//alias uint32_t in_addr_t;

//struct in_addr
//{
// in_addr_t s_addr;
//}

private enum __SOCK_SIZE__ = 16;

struct sockaddr_in
Expand All @@ -115,10 +131,18 @@ else version( OSX )
enum uint INADDR_ANY = 0x00000000;
enum uint INADDR_BROADCAST = 0xffffffff;

enum INET_ADDRSTRLEN = 16;
//enum INET_ADDRSTRLEN = 16;
}
else version( FreeBSD )
{
//alias uint16_t in_port_t;
//alias uint32_t in_addr_t;

//struct in_addr
//{
// in_addr_t s_addr;
//}

struct sockaddr_in
{
ubyte sin_len;
Expand All @@ -138,6 +162,8 @@ else version( FreeBSD )

enum uint INADDR_ANY = 0x00000000;
enum uint INADDR_BROADCAST = 0xffffffff;

//enum INET_ADDRSTRLEN = 16;
}


Expand Down Expand Up @@ -232,7 +258,7 @@ version ( linux )
{
IPPROTO_IPV6 = 41,

INET6_ADDRSTRLEN = 46,
//INET6_ADDRSTRLEN = 46,

IPV6_JOIN_GROUP = 20,
IPV6_LEAVE_GROUP = 21,
Expand Down Expand Up @@ -355,7 +381,7 @@ else version( OSX )
{
IPPROTO_IPV6 = 41,

INET6_ADDRSTRLEN = 46,
//INET6_ADDRSTRLEN = 46,

IPV6_JOIN_GROUP = 12,
IPV6_LEAVE_GROUP = 13,
Expand Down Expand Up @@ -474,23 +500,20 @@ else version( FreeBSD )
in6_addr ipv6mr_multiaddr;
uint ipv6mr_interface;
}

enum INET6_ADDRSTRLEN = 46;
enum IPPROTO_IPV6 = 41; // <netinet/in.h>

enum

enum : uint
{
IPV6_SOCKOPT_RESERVED1 = 3,
IPV6_UNICAST_HOPS = 4,
IPV6_MULTICAST_IF = 9,
IPV6_MULTICAST_HOPS = 10,
IPV6_MULTICAST_LOOP = 11,
IPV6_JOIN_GROUP = 12,
IPV6_LEAVE_GROUP = 13,
IPV6_PORTRANGE = 14,
ICMP6_FILTER = 18,
IPV6_CHECKSUM = 26,
IPV6_V6ONLY = 27,
IPPROTO_IPV6 = 41,

//INET6_ADDRSTRLEN = 46,

IPV6_JOIN_GROUP = 12,
IPV6_LEAVE_GROUP = 13,
IPV6_MULTICAST_HOPS = 10,
IPV6_MULTICAST_IF = 9,
IPV6_MULTICAST_LOOP = 11,
IPV6_UNICAST_HOPS = 4,
IPV6_V6ONLY = 27,
}

private enum
Expand Down

0 comments on commit ab485ce

Please sign in to comment.