Implement vasprintf and asprintf for platforms lacking them.
This commit is contained in:
9
util.h
9
util.h
@@ -40,6 +40,9 @@
|
||||
#define ISPC_UTIL_H
|
||||
|
||||
#include "ispc.h"
|
||||
#ifdef ISPC_IS_WINDOWS
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
struct SourcePos;
|
||||
|
||||
@@ -62,6 +65,12 @@ inline uint32_t RoundUpPow2(uint32_t v) {
|
||||
#define PRINTF_FUNC
|
||||
#endif // __GNUG__
|
||||
|
||||
// for cross-platform compatibility
|
||||
#ifdef ISPC_IS_WINDOWS
|
||||
int vasprintf(char **sptr, const char *fmt, va_list argv);
|
||||
int asprintf(char **sptr, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
/** Prints a debugging message. These messages are only printed if
|
||||
g->debugPrint is \c true. In addition to a program source code
|
||||
position to associate with the message, a printf()-style format string
|
||||
|
||||
Reference in New Issue
Block a user