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:
Howard Hinnant
2011-09-22 19:10:18 +00:00
parent 59832523ac
commit 92a07003b2
10 changed files with 433 additions and 5 deletions

View 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;
}