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:Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by:
Mikhail Gusarov <dottedmag@dottedmag.net>
Showing
- COPYING 1 addition, 1 deletionCOPYING
- configure.ac 1 addition, 1 deletionconfigure.ac
- hw/xfree86/loader/sdksyms.sh 1 addition, 0 deletionshw/xfree86/loader/sdksyms.sh
- include/Makefile.am 1 addition, 0 deletionsinclude/Makefile.am
- include/Xprintf.h 69 additions, 0 deletionsinclude/Xprintf.h
- include/dix-config.h.in 3 additions, 0 deletionsinclude/dix-config.h.in
- include/os.h 8 additions, 4 deletionsinclude/os.h
- os/xprintf.c 146 additions, 24 deletionsos/xprintf.c
Loading
Please register or sign in to comment