From fccc74ef54f082afe7db64e39c8e3ab9e5d111a9 Mon Sep 17 00:00:00 2001 From: "David G. Holm" Date: Fri, 7 May 2004 01:16:25 +0000 Subject: [PATCH] See ChangeLog entry 2004-05-06 21:10 UTC-0400 David G. Holm --- harbour/ChangeLog | 5 +++++ harbour/source/vm/itemapi.c | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c0106b3d31..90e45fe6a8 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,11 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2004-05-06 21:10 UTC-0400 David G. Holm + * source/vm/itemapi.c + ! The funtion snprintf is not a Standard C function and does not + exist in the Version 12 of the Microsoft C++ compiler (MSVC 6). + 2004-05-06 18:00 UTC+0100 Ryszard Glab + CVSROOT/avail * CVSROOT/checkoutlist diff --git a/harbour/source/vm/itemapi.c b/harbour/source/vm/itemapi.c index be7d496505..14458891d6 100644 --- a/harbour/source/vm/itemapi.c +++ b/harbour/source/vm/itemapi.c @@ -1410,14 +1410,22 @@ char * HB_EXPORT hb_itemString( PHB_ITEM pItem, ULONG * ulLen, BOOL * bFreeReq ) case HB_IT_POINTER: { + #ifdef _MSC_VER + int size = 16; /* 8 bytes for address + 0x + \0 + padding (no snprintf function) */ + #else int size = 11; /* 8 bytes for address + 0x + \0 */ + #endif int n; BOOL bFail = TRUE; buffer = ( char * ) hb_xgrab( size ); do { + #ifdef _MSC_VER + n = sprintf( buffer, "%p", hb_itemGetPtr( pItem ) ); + #else n = snprintf( buffer, size, "%p", hb_itemGetPtr( pItem ) ); + #endif if( (n > -1) && (n < size) ) { bFail = FALSE; @@ -1428,7 +1436,7 @@ char * HB_EXPORT hb_itemString( PHB_ITEM pItem, ULONG * ulLen, BOOL * bFreeReq ) size = n + 1; else size *= 2; - buffer = hb_xrealloc( buffer, size ); + buffer = ( char * ) hb_xrealloc( buffer, size ); } } while( bFail );