[libcxx] r323237 - libcxx: Rename vasprintf function to __libcpp_vasprintf.
Peter Collingbourne via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 23 10:53:33 PST 2018
Author: pcc
Date: Tue Jan 23 10:53:33 2018
New Revision: 323237
URL: http://llvm.org/viewvc/llvm-project?rev=323237&view=rev
Log:
libcxx: Rename vasprintf function to __libcpp_vasprintf.
The language standard does not define a function with this name,
so it is part of the user's namespace. This change fixes a duplicate
symbol error that occurs when a user attempts to define a function
with this name.
Differential Revision: https://reviews.llvm.org/D42405
Modified:
libcxx/trunk/include/stdio.h
libcxx/trunk/src/support/win32/locale_win32.cpp
libcxx/trunk/src/support/win32/support.cpp
Modified: libcxx/trunk/include/stdio.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/stdio.h?rev=323237&r1=323236&r2=323237&view=diff
==============================================================================
--- libcxx/trunk/include/stdio.h (original)
+++ libcxx/trunk/include/stdio.h Tue Jan 23 10:53:33 2018
@@ -109,13 +109,6 @@ void perror(const char* s);
#ifdef __cplusplus
-// snprintf
-#if defined(_LIBCPP_MSVCRT_LIKE)
-extern "C" {
-int vasprintf(char **sptr, const char *__restrict fmt, va_list ap);
-}
-#endif
-
#undef getc
#undef putc
#undef clearerr
Modified: libcxx/trunk/src/support/win32/locale_win32.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/support/win32/locale_win32.cpp?rev=323237&r1=323236&r2=323237&view=diff
==============================================================================
--- libcxx/trunk/src/support/win32/locale_win32.cpp (original)
+++ libcxx/trunk/src/support/win32/locale_win32.cpp Tue Jan 23 10:53:33 2018
@@ -13,6 +13,8 @@
#include <memory>
#include <type_traits>
+int __libcpp_vasprintf(char **sptr, const char *__restrict fmt, va_list ap);
+
using std::__libcpp_locale_guard;
// FIXME: base currently unused. Needs manual work to construct the new locale
@@ -105,7 +107,7 @@ int asprintf_l( char **ret, locale_t loc
int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap )
{
__libcpp_locale_guard __current(loc);
- return vasprintf( ret, format, ap );
+ return __libcpp_vasprintf( ret, format, ap );
}
#if !defined(_LIBCPP_MSVCRT)
Modified: libcxx/trunk/src/support/win32/support.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/support/win32/support.cpp?rev=323237&r1=323236&r2=323237&view=diff
==============================================================================
--- libcxx/trunk/src/support/win32/support.cpp (original)
+++ libcxx/trunk/src/support/win32/support.cpp Tue Jan 23 10:53:33 2018
@@ -19,7 +19,7 @@
// Like sprintf, but when return value >= 0 it returns
// a pointer to a malloc'd string in *sptr.
// If return >= 0, use free to delete *sptr.
-int vasprintf( char **sptr, const char *__restrict format, va_list ap )
+int __libcpp_vasprintf( char **sptr, const char *__restrict format, va_list ap )
{
*sptr = NULL;
// Query the count required.
More information about the cfe-commits
mailing list