mdbx: add public MDBX_MAYBE_UNUSED.

This also should fix C++ mdbx API build by MSVC 2015.
This commit is contained in:
Leonid Yuriev
2021-05-11 20:14:09 +03:00
parent ed58ff9f81
commit ebab75642e
8 changed files with 51 additions and 50 deletions

View File

@@ -204,7 +204,8 @@ template <typename PATH> struct path_to_pchar {
operator const char *() const { return str.c_str(); }
};
template <typename PATH>[[maybe_unused]] PATH pchar_to_path(const char *c_str) {
template <typename PATH>
MDBX_MAYBE_UNUSED PATH pchar_to_path(const char *c_str) {
return PATH(c_str);
}
@@ -242,7 +243,7 @@ template <> struct path_to_pchar<std::wstring> {
};
template <>
[[maybe_unused]] std::wstring pchar_to_path<std::wstring>(const char *c_str) {
MDBX_MAYBE_UNUSED std::wstring pchar_to_path<std::wstring>(const char *c_str) {
std::wstring wstr;
if (c_str && *c_str) {
const int chars = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, c_str,