[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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351027 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/__config b/include/__config
index 7283876..e82d7fe 100644
--- a/include/__config
+++ b/include/__config
@@ -1424,6 +1424,8 @@
 #  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
diff --git a/include/locale b/include/locale
index ac589d3..2043892 100644
--- a/include/locale
+++ b/include/locale
@@ -3568,6 +3568,7 @@
         __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 @@
                                                         __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 @@
         __c <<= 1;
     nl_catd __cat = (nl_catd)__c;
     catclose(__cat);
+#else // !_LIBCPP_HAS_CATOPEN
+    _LIBCPP_UNUSED_VAR(__c);
 #endif // _LIBCPP_HAS_CATOPEN
 }