2008-10-27 12:03 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* make_vc.mak
  * contrib/mtpl_vc.mak
    - Removed no longer necessary '-D_CRT_SECURE_NO_DEPRECATE' 
      for MSVS 2005 and upper.

  * include/hbsetup.h
    * Mapping snprintf() calls to hb_snprintf().
    ; TODO: Replace the calls in source code.

  * source/common/hbstr.c
    ! Fixed hb_snprintf(). Please verify on your platforms.
    ; TODO: It may need further tweaking to smooth out the 
            platform implementation differences.
This commit is contained in:
Viktor Szakats
2008-10-27 11:11:02 +00:00
parent b5e9969713
commit d1dc70f971
5 changed files with 30 additions and 26 deletions

View File

@@ -8,6 +8,21 @@
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2008-10-27 12:03 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* make_vc.mak
* contrib/mtpl_vc.mak
- Removed no longer necessary '-D_CRT_SECURE_NO_DEPRECATE'
for MSVS 2005 and upper.
* include/hbsetup.h
* Mapping snprintf() calls to hb_snprintf().
; TODO: Replace the calls in source code.
* source/common/hbstr.c
! Fixed hb_snprintf(). Please verify on your platforms.
; TODO: It may need further tweaking to smooth out the
platform implementation differences.
2008-10-27 11:29 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbapi.h
* source/common/hbstr.c

View File

@@ -109,7 +109,7 @@ HB_VISUALC_VER = 80
# C Compiler Flags
!if $(HB_VISUALC_VER) >= 80
CFLAGS_VER = -Ot2b1 -EHs-c- -D_CRT_SECURE_NO_DEPRECATE
CFLAGS_VER = -Ot2b1 -EHs-c-
!else
CFLAGS_VER = -Ogt2yb1p -GX- -G6 -YX
!endif

View File

@@ -55,6 +55,7 @@
#include <limits.h>
/* ***********************************************************************
* Include settings common for .prg and .c files
*/
@@ -396,24 +397,12 @@
*/
#if defined( __DJGPP__ )
/* Fix DJGPP in call to: toupper(), tolower(), is...()
*/
/* Fix DJGPP in call to: toupper(), tolower(), is...() */
#include "hbfixdj.h"
/* Substitute snprintf() by sprintf() for DJGPP <= 2.03.
* This is a temporary hack, should implement a C99 snprintf() ourselves.
*/
#if ( __DJGPP__ < 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ <= 3 ) )
#define snprintf(s, len, args...) sprintf( (s), ##args )
#endif
#elif defined( _MSC_VER ) || defined( __DMC__ ) && !defined( __XCC__ )
#define snprintf _snprintf
#elif defined( __WATCOMC__ )
#if __WATCOMC__ < 1200
#define snprintf _bprintf
#endif
#endif
#define snprintf hb_snprintf
/* ***********************************************************************
* Extern "C" detection
*/

View File

@@ -99,7 +99,7 @@ VMMT_LIB_OBJS = $(VM_LIB_OBJS:obj\vc=obj\vc_mt)
!if "$(HB_BUILD_WINCE)" == "yes"
!if $(HB_VISUALC_VER) >= 80
CFLAGS_VER = -Od -Os -Gy -GS- -EHsc- -Gm -Zi -GR- -D_CRT_SECURE_NO_DEPRECATE
CFLAGS_VER = -Od -Os -Gy -GS- -EHsc- -Gm -Zi -GR-
!else
CFLAGS_VER = -Oxsb1 -EHsc -YX -GF
!endif
@@ -126,7 +126,7 @@ DBGMARKER = d
# NOTE: See here: http://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx
!if $(HB_VISUALC_VER) >= 80
CFLAGS_VER = -Ot2b1 -EHs-c- -D_CRT_SECURE_NO_DEPRECATE
CFLAGS_VER = -Ot2b1 -EHs-c-
!else
CFLAGS_VER = -Ogt2yb1p -GX- -G6 -YX
!endif

View File

@@ -1112,26 +1112,26 @@ char * hb_compDecodeString( int iMethod, const char * szText, ULONG * pulLen )
#undef _HB_SNPRINTF_ADD_EOS
#undef snprintf
/* NOTE: The full size of the buffer is expected as nSize. [vszakats] */
HB_EXPORT ULONG hb_snprintf( char * buffer, ULONG nSize, const char * format, ... )
ULONG hb_snprintf( char * buffer, ULONG nSize, const char * format, ... )
{
ULONG result;
va_list arglist;
ULONG result;
va_start( arglist, format );
#if defined( __DJGPP__ ) && ( __DJGPP__ < 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ <= 3 ) )
/* Use sprintf() for DJGPP <= 2.03.
/* Use vsprintf() for DJGPP <= 2.03.
This is a temporary hack, should implement a C99 snprintf() ourselves. */
result = sprintf( buffer, format, arglist );
result = vsprintf( buffer, format, arglist );
#elif defined( _MSC_VER ) && _MSC_VER >= 1400
result = _snprintf_s( buffer, nSize, _TRUNCATE, format, arglist );
result = _vsnprintf_s( buffer, nSize, _TRUNCATE, format, arglist );
#elif defined( _MSC_VER ) || defined( __DMC__ ) && !defined( __XCC__ )
result = _snprintf( buffer, nSize, format, arglist );
result = _vsnprintf( buffer, nSize, format, arglist );
#define _HB_SNPRINTF_ADD_EOS
#elif defined( __WATCOMC__ ) && __WATCOMC__ < 1200
result = _bprintf( buffer, nSize, format, arglist );
result = _vbprintf( buffer, nSize, format, arglist );
#else
result = snprintf( buffer, nSize, format, arglist );
result = vsnprintf( buffer, nSize, format, arglist );
#endif
#ifdef _HB_SNPRINTF_ADD_EOS