Skip to content
Snippets Groups Projects
Commit c95c1d33 authored by Alan Coopersmith's avatar Alan Coopersmith
Browse files

Add asprintf() implementation for platforms without it


Provides a portable implementation of this common allocating sprintf()
API found in many, but not yet all, of the platforms we support.
If the platform provides vasprintf() we simply wrap it, otherwise we
implement it - either way callers can use it regardless of platform.

Since not all platforms guarantee to NULL out the return pointer on
failure, we don't either, and require callers to check the return
value for -1.

The old Xprintf() API is deprecated, but left for compatibility for now.

The new API is added in a new header so that it can be used in parts of
the server such as hw/xfree86/parser that don't include all the server
headers.

Signed-off-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: default avatarMikhail Gusarov <dottedmag@dottedmag.net>
parent 2db69517
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment