GCC (at least of 4.7.2) does not support inlining of variadic functions.  In the
case that we are building with GCC, fall back to defining the variadic function
as static and let other compilers which are able to inline variadic functions
continue to do so.


http://llvm-reviews.chandlerc.com/D241

Files:
  include/locale

Index: include/locale
===================================================================
--- include/locale
+++ include/locale
@@ -354,7 +354,11 @@
 #endif
 }
 
+#if !defined(__clang__) && defined(__GNUC__)
+static
+#else
 _LIBCPP_ALWAYS_INLINE inline
+#endif
 int __sprintf_l(char *__s, locale_t __l, const char *__format, ...) {
   va_list __va;
   va_start(__va, __format);
@@ -368,7 +372,11 @@
   return __res;
 }
 
+#if !defined(__clang__) && defined(__GNUC__)
+static
+#else
 _LIBCPP_ALWAYS_INLINE inline
+#endif
 int __snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, 
...) {
   va_list __va;
   va_start(__va, __format);
@@ -382,7 +390,11 @@
   return __res;
 }
 
+#if !defined(__clang__) && defined(__GNUC__)
+static
+#else
 _LIBCPP_ALWAYS_INLINE inline
+#endif
 int __asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
   va_list __va;
   va_start(__va, __format);
@@ -396,7 +408,11 @@
   return __res;
 }
 
+#if !defined(__clang__) && defined(__GNUC__)
+static
+#else
 _LIBCPP_ALWAYS_INLINE inline
+#endif
 int __sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
   va_list __va;
   va_start(__va, __format);
Index: include/locale
===================================================================
--- include/locale
+++ include/locale
@@ -354,7 +354,11 @@
 #endif
 }
 
+#if !defined(__clang__) && defined(__GNUC__)
+static
+#else
 _LIBCPP_ALWAYS_INLINE inline
+#endif
 int __sprintf_l(char *__s, locale_t __l, const char *__format, ...) {
   va_list __va;
   va_start(__va, __format);
@@ -368,7 +372,11 @@
   return __res;
 }
 
+#if !defined(__clang__) && defined(__GNUC__)
+static
+#else
 _LIBCPP_ALWAYS_INLINE inline
+#endif
 int __snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {
   va_list __va;
   va_start(__va, __format);
@@ -382,7 +390,11 @@
   return __res;
 }
 
+#if !defined(__clang__) && defined(__GNUC__)
+static
+#else
 _LIBCPP_ALWAYS_INLINE inline
+#endif
 int __asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
   va_list __va;
   va_start(__va, __format);
@@ -396,7 +408,11 @@
   return __res;
 }
 
+#if !defined(__clang__) && defined(__GNUC__)
+static
+#else
 _LIBCPP_ALWAYS_INLINE inline
+#endif
 int __sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
   va_list __va;
   va_start(__va, __format);
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to