mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 00:32:35 +01:00
ircd: Add #ifdefs around potentially conflicting BSD stringops.
This commit is contained in:
parent
ed247e6200
commit
fe41932b1a
1 changed files with 4 additions and 0 deletions
|
@ -146,9 +146,11 @@ struct ircd::strlcpy
|
||||||
}()}
|
}()}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
#ifndef HAVE_STRLCPY
|
||||||
strlcpy(char *const &dst, const char *const &src, const size_t &max)
|
strlcpy(char *const &dst, const char *const &src, const size_t &max)
|
||||||
:strlcpy{dst, string_view{src, strnlen(src, max)}, max}
|
:strlcpy{dst, string_view{src, strnlen(src, max)}, max}
|
||||||
{}
|
{}
|
||||||
|
#endif
|
||||||
|
|
||||||
strlcpy(const mutable_buffer &dst, const string_view &src)
|
strlcpy(const mutable_buffer &dst, const string_view &src)
|
||||||
:strlcpy{data(dst), src, size(dst)}
|
:strlcpy{data(dst), src, size(dst)}
|
||||||
|
@ -184,9 +186,11 @@ struct ircd::strlcat
|
||||||
}()}
|
}()}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
#ifndef HAVE_STRLCAT
|
||||||
strlcat(char *const &dst, const char *const &src, const size_t &max)
|
strlcat(char *const &dst, const char *const &src, const size_t &max)
|
||||||
:strlcat{dst, string_view{src, ::strnlen(src, max)}, max}
|
:strlcat{dst, string_view{src, ::strnlen(src, max)}, max}
|
||||||
{}
|
{}
|
||||||
|
#endif
|
||||||
|
|
||||||
strlcat(const mutable_buffer &dst, const string_view &src)
|
strlcat(const mutable_buffer &dst, const string_view &src)
|
||||||
:strlcat{data(dst), src, size(dst)}
|
:strlcat{data(dst), src, size(dst)}
|
||||||
|
|
Loading…
Reference in a new issue