Add CMake build and fix major Linux blockers.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@121510 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/locale b/include/locale
index 6e807fb..60aab1d 100644
--- a/include/locale
+++ b/include/locale
@@ -265,7 +265,10 @@
 }
 
 #else  // __APPLE__
-inline _LIBCPP_INLINE_VISIBILITY
+inline
+#ifndef _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
+_LIBCPP_INLINE_VISIBILITY
+#endif
 int
 __nolocale_sprintf(char* __restrict __str,
                    const char* __restrict __format, ...)
@@ -276,7 +279,10 @@
     va_end(__ap);
     return __result;
 }
-inline _LIBCPP_INLINE_VISIBILITY
+inline
+#ifndef _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
+_LIBCPP_INLINE_VISIBILITY
+#endif
 int
 __nolocale_snprintf(char* __restrict __str, size_t __size,
                     const char* __restrict __format, ...)
@@ -287,7 +293,10 @@
     va_end(__ap);
     return __result;
 }
-inline _LIBCPP_INLINE_VISIBILITY
+inline
+#ifndef _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
+_LIBCPP_INLINE_VISIBILITY
+#endif
 int
 __nolocale_asprintf(char** __ret,
                     const char* __restrict __format, ...)
@@ -298,7 +307,10 @@
     va_end(__ap);
     return __result;
 }
-inline _LIBCPP_INLINE_VISIBILITY
+inline
+#ifndef _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
+_LIBCPP_INLINE_VISIBILITY
+#endif
 int
 __nolocale_sscanf(const char* __restrict __str,
                   const char* __restrict __format, ...)