[libcxx] Mark do_open, do_get and do_close parameters unused when catopen is missing

When catopen is missing, do_open, do_get and do_close end up being
no-op, and as such their parameters will be unused which triggers a
warning/error when building with -Wunused-parameter.

Differential Revision: https://reviews.llvm.org/D56023

llvm-svn: 351027
This commit is contained in:
Petr Hosek
2019-01-13 22:15:37 +00:00
parent 56ba1db933
commit 2fefe153dd
2 changed files with 8 additions and 0 deletions

View File

@@ -1424,6 +1424,8 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
# endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
#endif // _LIBCPP_NO_AUTO_LINK
#define _LIBCPP_UNUSED_VAR(x) ((void)(x))
#endif // __cplusplus
#endif // _LIBCPP_CONFIG

View File

@@ -3568,6 +3568,7 @@ messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const
__cat = static_cast<catalog>((static_cast<size_t>(__cat) >> 1));
return __cat;
#else // !_LIBCPP_HAS_CATOPEN
_LIBCPP_UNUSED_VAR(__nm);
return -1;
#endif // _LIBCPP_HAS_CATOPEN
}
@@ -3591,6 +3592,9 @@ messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
__n, __n + strlen(__n));
return __w;
#else // !_LIBCPP_HAS_CATOPEN
_LIBCPP_UNUSED_VAR(__c);
_LIBCPP_UNUSED_VAR(__set);
_LIBCPP_UNUSED_VAR(__msgid);
return __dflt;
#endif // _LIBCPP_HAS_CATOPEN
}
@@ -3604,6 +3608,8 @@ messages<_CharT>::do_close(catalog __c) const
__c <<= 1;
nl_catd __cat = (nl_catd)__c;
catclose(__cat);
#else // !_LIBCPP_HAS_CATOPEN
_LIBCPP_UNUSED_VAR(__c);
#endif // _LIBCPP_HAS_CATOPEN
}