Skip to content

Commit

Permalink
Moved constant out of static const to avoid linker errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Małecki committed May 24, 2019
1 parent e2a1426 commit bdd7ee2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions srtcore/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ m_BindAddr(version)
m_iSockAddrSize = (AF_INET == m_iIPversion) ? sizeof(sockaddr_in) : sizeof(sockaddr_in6);

// Do the check for ancillary data buffer size, kinda assertion
static const size_t CMSG_MAX_SPACE = sizeof (CMSGNodeAlike);

if (+CMSG_MAX_SPACE < CMSG_SPACE(sizeof(in_pktinfo))
|| +CMSG_MAX_SPACE < CMSG_SPACE(sizeof(in6_pktinfo)))
Expand Down
3 changes: 1 addition & 2 deletions srtcore/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ class CChannel
// As CMSG_SPACE is a runtime value (at least on this MinGW), it can only be runtime-checked.
// It will be done in CChannel constructor.

static const size_t CMSG_MAX_SPACE = sizeof (CMSGNodeAlike);
mutable char m_acCmsgBuffer [CMSG_MAX_SPACE]; // Reserved space for ancillary data with pktinfo
mutable char m_acCmsgBuffer [sizeof (CMSGNodeAlike)]; // Reserved space for ancillary data with pktinfo

#ifndef _WIN32 // This feature is not enabled on Windows, for now.
sockaddr_any getTargetAddress(const msghdr& msg) const
Expand Down

0 comments on commit bdd7ee2

Please sign in to comment.