Partial Windows port by Ruben Van Boxem
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@140328 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
22
src/support/win32/support.cpp
Normal file
22
src/support/win32/support.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
// -*- C++ -*-
|
||||
//===--------------------------- support/win32/support.h --------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
int vasprintf( char **sptr, const char *__restrict__ fmt, va_list ap )
|
||||
{
|
||||
*sptr = NULL
|
||||
int count = vsnprintf( *sptr, 0, fmt, ap );
|
||||
if( (count >= 0) && ((*sptr = malloc(count+1)) != NULL) )
|
||||
{
|
||||
vsprintf( *sptr, fmt, ap );
|
||||
sptr[count] = '\0';
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
Reference in New Issue
Block a user