Commit Graph

9 Commits

Author SHA1 Message Date
José Fonseca 7f08248c2e ralloc: Use _vscprintf on MinGW.
MinGW uses MSVC's runtime DLLs for most of C runtime's functions, and
there has same semantics for vsnprintf.

Not sure how this worked until now -- maybe one of the internal
vsnprintf implementations was taking precedence.
2011-11-01 08:47:39 +00:00
Vinson Lee 20a20c781a ralloc: Move declaration before code.
Fixes build error with MSVC.
2011-10-25 20:31:14 -07:00
Kenneth Graunke ca95593d49 ralloc: Add new [v]asprintf_rewrite_tail functions.
This can be useful if you want to create a bunch of temporary strings
with a common prefix.  For example, when iterating over uniform
structure fields, one might want to create temporary strings like
"pallete.primary", "palette.outline", and "pallette.shadow".

This could be done by overwriting the '.' with a null-byte and calling
ralloc_asprintf_append, but that incurs the cost of strlen("pallete")
every time...when this is already known.

These new functions allow you rewrite the tail of the string, given a
starting index.  If the starting index is the length of the string, this
is equivalent to appending.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-25 17:51:43 -07:00
Chia-I Wu b34770d834 ralloc: include limits.h for SIZE_MAX on Android
Android does not define SIZE_MAX in stdint.h.  We have to include
limits.h for it.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:48 +08:00
Vinson Lee cde443e0b9 ralloc: Add missing va_end following va_copy. 2011-02-03 22:10:16 -08:00
José Fonseca 3c701f1d61 glsl: Fix printf_length() on MSVC. 2011-02-01 10:41:46 +00:00
José Fonseca 3ae7aa3403 glsl: Define va_copy on MSVC. 2011-01-31 20:53:03 +00:00
Kenneth Graunke 42fd9c2ebb ralloc: a new MIT-licensed recursive memory allocator. 2011-01-31 10:17:09 -08:00
Kenneth Graunke dc55254f5b ralloc: Add a fake implementation of ralloc based on talloc. 2011-01-31 10:17:09 -08:00