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

Commit

Permalink
Add inout qualifiers to CMSG_* "functions"
Browse files Browse the repository at this point in the history
These are macros in the C headers, so this functionality matches there.
EXCEPT for CMSG_NXTHDR, which is a function.  It doesn't actually take
const arguments...
  • Loading branch information
todayman committed Nov 21, 2014
1 parent 19b8ff8 commit 47ffda6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/sys/posix/sys/socket.d
Expand Up @@ -189,19 +189,19 @@ version( linux )
}
else
{
extern (D) ubyte* CMSG_DATA( cmsghdr* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
extern (D) inout(ubyte)* CMSG_DATA( inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
}

/*private*/ cmsghdr* __cmsg_nxthdr(msghdr*, cmsghdr*) pure nothrow @nogc;
/*private*/ inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
// FIXME the alias is unusable because the target of the alias is private.
// Is this a bug?
alias __cmsg_nxthdr CMSG_NXTHDR;

extern (D) cmsghdr* CMSG_FIRSTHDR( msghdr* mhdr ) pure nothrow @nogc
extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
{
return ( cast(size_t)mhdr.msg_controllen >= cmsghdr.sizeof
? cast(cmsghdr*) mhdr.msg_control
: cast(cmsghdr*) null );
? cast(inout(cmsghdr)*) mhdr.msg_control
: cast(inout(cmsghdr)*) null );
}

extern (D)
Expand Down

0 comments on commit 47ffda6

Please sign in to comment.