diff options
author | marha <marha@users.sourceforge.net> | 2009-07-12 18:20:04 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-07-12 18:20:04 +0000 |
commit | da8fe31a7ba4acf109097d5696ad0145b991cdfd (patch) | |
tree | 1c74d6f075702a73e557872f2a6f020ea4eb5432 /xorg-server/os/xprintf.c | |
parent | 6590f805a12779909cb8504c230fa367148fe38c (diff) | |
parent | 529dcfd0858d75cb3c87c73cb0f81dd20bbb9230 (diff) | |
download | vcxsrv-da8fe31a7ba4acf109097d5696ad0145b991cdfd.tar.gz vcxsrv-da8fe31a7ba4acf109097d5696ad0145b991cdfd.tar.bz2 vcxsrv-da8fe31a7ba4acf109097d5696ad0145b991cdfd.zip |
Changes for VC compilation
Diffstat (limited to 'xorg-server/os/xprintf.c')
-rw-r--r-- | xorg-server/os/xprintf.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xorg-server/os/xprintf.c b/xorg-server/os/xprintf.c index 07eaa1f58..bf70661ac 100644 --- a/xorg-server/os/xprintf.c +++ b/xorg-server/os/xprintf.c @@ -39,7 +39,9 @@ # ifdef __va_copy # define va_copy __va_copy # else +# ifndef _MSC_VER # error "no working va_copy was found" +# endif # endif #endif @@ -48,11 +50,16 @@ Xvprintf(const char *format, va_list va) { char *ret; int size; + +#ifdef _MSC_VER + size = vsnprintf(NULL, 0, format, va); +#else va_list va2; va_copy(va2, va); size = vsnprintf(NULL, 0, format, va2); va_end(va2); +#endif ret = (char *)Xalloc(size + 1); if (ret == NULL) @@ -78,11 +85,16 @@ XNFvprintf(const char *format, va_list va) { char *ret; int size; + +#ifdef _MSC_VER + size = vsnprintf(NULL, 0, format, va); +#else va_list va2; va_copy(va2, va); size = vsnprintf(NULL, 0, format, va2); va_end(va2); +#endif ret = (char *)XNFalloc(size + 1); if (ret == NULL) |