From 61c3e1dbb5c37ce5a6fb7ffa143b1cf25e2aee5e Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 28 Jan 2009 13:21:38 +0000 Subject: [PATCH] 2009-01-28 14:25 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/common/hbprintf.c ! include float.h in MSVC builds * changed code a little bit to pacify MSVC warning --- harbour/ChangeLog | 5 +++++ harbour/source/common/hbprintf.c | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6ddc5023c8..696d978883 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,11 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-01-28 14:25 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/common/hbprintf.c + ! include float.h in MSVC builds + * changed code a little bit to pacify MSVC warning + 2009-01-28 13:29 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/common/hbprintf.c * redefine [u]intmax_t as [U]LONGLONG in MSVC builds. diff --git a/harbour/source/common/hbprintf.c b/harbour/source/common/hbprintf.c index 381c0e2ca4..f2a6978fea 100644 --- a/harbour/source/common/hbprintf.c +++ b/harbour/source/common/hbprintf.c @@ -102,7 +102,7 @@ optimized. #include "hbapi.h" #include "hbmath.h" -#if defined( __BORLANDC__ ) || defined( __WATCOMC__ ) +#if defined( __BORLANDC__ ) || defined( __WATCOMC__ ) || defined( _MSC_VER ) # include #elif defined(__DJGPP__) _LIB_VERSION_TYPE _LIB_VERSION = _XOPEN_; @@ -219,7 +219,7 @@ HB_EXTERN_END defined(__XCC__) || defined(__POCC__) || \ defined(HB_OS_HPUX) # define hb_isfinite( d ) isfinite( d ) -# elif defined(__WATCOMC__) || defined(__BORLANDC__) || defined(_MSC_VER) +# elif defined( __BORLANDC__ ) || defined( __WATCOMC__ ) || defined( _MSC_VER ) # define hb_isfinite( d ) _finite( d ) # elif defined(__GNUC__) || defined(__DJGPP__) || defined(__MINGW32__) || \ defined(__LCC__) @@ -839,14 +839,13 @@ int hb_snprintf_c( char * buffer, size_t bufsize, const char * format, ... ) params.size = _ARGBUF_SIZE; params.maxarg = 0; params.arglst = argbuf; - params.repeat = TRUE; #endif #ifndef __NO_ARGPOS__ - while( params.repeat ) + do { - params.repeat = 0; + params.repeat = FALSE; if( params.maxarg > 0 ) { va_start( args, format ); @@ -1180,6 +1179,8 @@ int hb_snprintf_c( char * buffer, size_t bufsize, const char * format, ... ) #ifndef __NO_ARGPOS__ } + while( params.repeat ); + if( params.arglst != argbuf ) hb_xfree( params.arglst ); #endif