0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 02:02:38 +01:00

ircd: Fixes for macro collision (gnu++20).

This commit is contained in:
Jason Volk 2022-06-17 19:57:38 -07:00
parent 3f4621461c
commit 211ea6ba55
3 changed files with 14 additions and 4 deletions

View file

@ -24,8 +24,10 @@ namespace ircd::rfc1035
enum class op :uint8_t;
// Section 2.3.4 Size Limits
constexpr size_t LABEL_MAX {63};
#ifndef NAME_MAX
constexpr size_t NAME_MAX {255};
#endif
constexpr size_t LABEL_MAX {63};
constexpr size_t TTL_MAX {std::numeric_limits<int32_t>::max()};
constexpr size_t LABEL_BUFSIZE {LABEL_MAX + 1};

View file

@ -21,10 +21,14 @@ namespace ircd::rfc3986
IRCD_EXCEPTION(coding_error, encoding_error)
IRCD_EXCEPTION(coding_error, decoding_error)
#ifndef NAME_MAX
constexpr size_t DOMAIN_MAX { rfc1035::NAME_MAX };
#else
constexpr size_t DOMAIN_MAX { NAME_MAX };
#endif
constexpr size_t DOMAIN_BUFSIZE { DOMAIN_MAX + 1 };
constexpr size_t HOSTNAME_MAX { rfc1035::LABEL_MAX };
constexpr size_t HOSTNAME_BUFSIZE { HOSTNAME_MAX + 1 };
constexpr size_t DOMAIN_MAX { rfc1035::NAME_MAX };
constexpr size_t DOMAIN_BUFSIZE { DOMAIN_MAX + 1 };
constexpr size_t REMOTE_MAX { DOMAIN_MAX + 6 };
constexpr size_t REMOTE_BUFSIZE { REMOTE_MAX + 1 };

View file

@ -184,7 +184,11 @@ get__query_directory(client &client,
{
static const size_t max_servers
{
#ifdef NAME_MAX
size(buf) / NAME_MAX - 2
#else
size(buf) / rfc1035::NAME_MAX - 2
#endif
};
const m::room::origins origins