From 2f4a4000cd64c1424a7286f84ed8ddc79799e05c Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 1 Apr 2011 09:32:07 +0000 Subject: [PATCH] fixed issues of watcomc for _win32 in stdio.c --- qse/include/qse/cmn/stdio.h | 19 +++++++++++++++---- qse/lib/cmn/stdio.c | 14 +++++++------- qse/watcom/qse.wpj | 22 +++++++++++----------- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/qse/include/qse/cmn/stdio.h b/qse/include/qse/cmn/stdio.h index 35f0348b..17c13160 100644 --- a/qse/include/qse/cmn/stdio.h +++ b/qse/include/qse/cmn/stdio.h @@ -32,7 +32,7 @@ #include #include -#if defined(_WIN32) +#if defined(_WIN32) && !defined(__WATCOMC__) #include #define qse_printf _tprintf @@ -73,10 +73,21 @@ typedef int (*qse_getdelim_t) (const qse_char_t* ptr,qse_size_t len,void* arg); extern "C" { #endif -int qse_vsprintf (qse_char_t* buf, size_t size, const qse_char_t* fmt, va_list ap); -int qse_sprintf (qse_char_t* buf, size_t size, const qse_char_t* fmt, ...); +int qse_vsprintf ( + qse_char_t* buf, + qse_size_t size, + const qse_char_t* fmt, + va_list ap +); -#if !defined(_WIN32) +int qse_sprintf ( + qse_char_t* buf, + qse_size_t size, + const qse_char_t* fmt, + ... +); + +#if !defined(_WIN32) || defined(__WATCOMC__) int qse_vfprintf (QSE_FILE *stream, const qse_char_t* fmt, va_list ap); int qse_vprintf (const qse_char_t* fmt, va_list ap); int qse_fprintf (QSE_FILE* file, const qse_char_t* fmt, ...); diff --git a/qse/lib/cmn/stdio.c b/qse/lib/cmn/stdio.c index 2454cc79..b43ad7f1 100644 --- a/qse/lib/cmn/stdio.c +++ b/qse/lib/cmn/stdio.c @@ -29,9 +29,9 @@ #define PATH_MAX 2048 #endif -#if defined(_WIN32) +#if defined(_WIN32) && !defined(__WATCOMC__) -int qse_vsprintf (qse_char_t* buf, size_t size, const qse_char_t* fmt, va_list ap) +int qse_vsprintf (qse_char_t* buf, qse_size_t size, const qse_char_t* fmt, va_list ap) { int n; @@ -49,7 +49,7 @@ int qse_vsprintf (qse_char_t* buf, size_t size, const qse_char_t* fmt, va_list a return n; } -int qse_sprintf (qse_char_t* buf, size_t size, const qse_char_t* fmt, ...) +int qse_sprintf (qse_char_t* buf, qse_size_t size, const qse_char_t* fmt, ...) { int n; va_list ap; @@ -106,7 +106,7 @@ int qse_printf (const qse_char_t* fmt, ...) return n; } -int qse_vsprintf (qse_char_t* buf, size_t size, const qse_char_t* fmt, va_list ap) +int qse_vsprintf (qse_char_t* buf, qse_size_t size, const qse_char_t* fmt, va_list ap) { int n; qse_char_t* nf = __adjust_format (fmt); @@ -114,7 +114,7 @@ int qse_vsprintf (qse_char_t* buf, size_t size, const qse_char_t* fmt, va_list a #if defined(QSE_CHAR_IS_MCHAR) n = vsnprintf (buf, size, nf, ap); -#elif defined(_WIN32) +#elif defined(_WIN32) && !defined(__WATCOMC__) n = _vsnwprintf (buf, size, nf, ap); #else n = vswprintf (buf, size, nf, ap); @@ -129,7 +129,7 @@ int qse_vsprintf (qse_char_t* buf, size_t size, const qse_char_t* fmt, va_list a return n; } -int qse_sprintf (qse_char_t* buf, size_t size, const qse_char_t* fmt, ...) +int qse_sprintf (qse_char_t* buf, qse_size_t size, const qse_char_t* fmt, ...) { int n; va_list ap; @@ -279,7 +279,7 @@ static qse_char_t* __adjust_format (const qse_char_t* format) } else if (ch == QSE_T('C') || ch == QSE_T('S')) { -#if defined(_WIN32) +#if defined(_WIN32) && !defined(__WATCOMC__) ADDC (buf, ch); #else #ifdef QSE_CHAR_IS_MCHAR diff --git a/qse/watcom/qse.wpj b/qse/watcom/qse.wpj index ecb40cad..7295f40e 100755 --- a/qse/watcom/qse.wpj +++ b/qse/watcom/qse.wpj @@ -181,7 +181,7 @@ VComponent 39 WRect 2020 -1693 +1680 5700 4240 1 @@ -196,24 +196,24 @@ debug/os2/cmd/scm/qsescm.tgt VComponent 42 WRect -1760 -1360 +980 +1093 5700 4240 -1 +0 0 43 WFileName 30 debug/win32/lib/cmn/qsecmn.tgt -38 -38 +18 +24 44 VComponent 45 WRect -180 -1240 +200 +1253 5700 4240 1 @@ -228,11 +228,11 @@ debug/win32/lib/scm/qsescm.tgt VComponent 48 WRect -3270 +3280 40 5700 4240 -1 +0 0 49 WFileName @@ -240,4 +240,4 @@ WFileName debug/win32/cmd/scm/qsescm.tgt 0 1 -32 +41