From bc6e1a9b3e9f33985c6a4364879b7816a1aa19cb Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 12 Feb 2009 10:03:45 +0000 Subject: [PATCH] 2009-02-12 10:57 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * include/hbsetup.h * include/hbapi.h * source/common/hbprintf.c * source/common/hbstr.c + Temporarily enabled local hb_snprintf() implementation. ; Please test. If it's okay, we can enable it permanently. * contrib/rddsql/sddmy/make_b32.bat * contrib/rddsql/sddmy/make_vc.bat * contrib/rddsql/sddpg/make_b32.bat * contrib/rddsql/sddpg/make_vc.bat * contrib/rddsql/sddfb/make_b32.bat * contrib/rddsql/sddfb/make_vc.bat ! Fixed typos for VC flavours. % Removed unnecessary INCLUDE path. * source/vm/maindllp.c ! Updated dll name for Borland and MSVC. * source/lang/msguawin.c * source/lang/msgua866.c * source/lang/msguakoi.c ! Fixed corrupted equal char in code. ! Fixed date format. ! Fixed CP IDs and descriptions in UA866 and UAKOI. ! Restored 'CA-Cl*pper' in comment. ; Please verify me. --- harbour/ChangeLog | 33 +++++++++++++++++++++-- harbour/contrib/rddsql/sddfb/make_b32.bat | 2 +- harbour/contrib/rddsql/sddfb/make_vc.bat | 2 +- harbour/contrib/rddsql/sddmy/make_b32.bat | 2 +- harbour/contrib/rddsql/sddmy/make_vc.bat | 4 +-- harbour/contrib/rddsql/sddpg/make_b32.bat | 2 +- harbour/contrib/rddsql/sddpg/make_vc.bat | 4 +-- harbour/include/hbapi.h | 4 +++ harbour/include/hbsetup.h | 1 + harbour/source/common/hbprintf.c | 13 +++------ harbour/source/common/hbstr.c | 4 +++ harbour/source/lang/msgua866.c | 19 +++++++------ harbour/source/lang/msguakoi.c | 19 +++++++------ harbour/source/lang/msguawin.c | 5 ++-- harbour/source/vm/maindllp.c | 4 +-- 15 files changed, 73 insertions(+), 45 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2dc67e4055..c23aa8b0e5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,35 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-02-12 10:57 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * include/hbsetup.h + * include/hbapi.h + * source/common/hbprintf.c + * source/common/hbstr.c + + Temporarily enabled local hb_snprintf() implementation. + ; Please test. If it's okay, we can enable it permanently. + + * contrib/rddsql/sddmy/make_b32.bat + * contrib/rddsql/sddmy/make_vc.bat + * contrib/rddsql/sddpg/make_b32.bat + * contrib/rddsql/sddpg/make_vc.bat + * contrib/rddsql/sddfb/make_b32.bat + * contrib/rddsql/sddfb/make_vc.bat + ! Fixed typos for VC flavours. + % Removed unnecessary INCLUDE path. + + * source/vm/maindllp.c + ! Updated dll name for Borland and MSVC. + + * source/lang/msguawin.c + * source/lang/msgua866.c + * source/lang/msguakoi.c + ! Fixed corrupted equal char in code. + ! Fixed date format. + ! Fixed CP IDs and descriptions in UA866 and UAKOI. + ! Restored 'CA-Cl*pper' in comment. + ; Please verify me. + 2009-02-12 11:43 UTC+0200 Petr Chornyj (myorg63 at mail.ru) * /source/lang/msguawin.c * /source/lang/msgua866.c @@ -18,7 +47,7 @@ * /source/lang/msguawin.c * /source/lang/msgua866.c * /source/lang/msguakoi.c - * Corrected bad Ukrainian localization + * Corrected bad Ukrainian localization 2009-12-11 18:09 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/gtwvg/wvgwin.c @@ -35,7 +64,7 @@ * harbour/contrib/gtwvg/wvgstatc.prg * harbour/contrib/gtwvg/wvgtoolb.prg * harbour/contrib/gtwvg/wvgwnd.prg - ! Numerous enhancements and fixes, difficult to remember as + ! Numerous enhancements and fixes, difficult to remember as most are spread over a long time and where I had no means to update them. But all are synchronized with changes effected till date by others. diff --git a/harbour/contrib/rddsql/sddfb/make_b32.bat b/harbour/contrib/rddsql/sddfb/make_b32.bat index 765b3e9831..bc8858663c 100644 --- a/harbour/contrib/rddsql/sddfb/make_b32.bat +++ b/harbour/contrib/rddsql/sddfb/make_b32.bat @@ -21,7 +21,7 @@ if "%HB_INC_FIREBIRD%" == "" set HB_INC_FIREBIRD=%HB_DIR_FIREBIRD%\include set _HB_DLL_NAME=fbclient set HB_ROOT=..\..\.. set HB_MAKEFILE=..\..\mtpl_b32.mak -set CFLAGS=-I"%HB_INC_FIREBIRD%";..\..\..\include +set CFLAGS=-I"%HB_INC_FIREBIRD%" rem --------------------------------------------------------------- diff --git a/harbour/contrib/rddsql/sddfb/make_vc.bat b/harbour/contrib/rddsql/sddfb/make_vc.bat index 93c68266fe..88c5450f8b 100644 --- a/harbour/contrib/rddsql/sddfb/make_vc.bat +++ b/harbour/contrib/rddsql/sddfb/make_vc.bat @@ -67,4 +67,4 @@ if "%1" == "INSTALL" goto POST_INSTALL set CFLAGS= set _HB_DLL_NAME= set _HB_INSTALL_PREFIX= -set _HB_LIB_INSTALL= \ No newline at end of file +set _HB_LIB_INSTALL= diff --git a/harbour/contrib/rddsql/sddmy/make_b32.bat b/harbour/contrib/rddsql/sddmy/make_b32.bat index 7279829e4f..f36af4fc09 100644 --- a/harbour/contrib/rddsql/sddmy/make_b32.bat +++ b/harbour/contrib/rddsql/sddmy/make_b32.bat @@ -22,7 +22,7 @@ set _HB_DLL_NAME=libmySQL set _HB_DLL_DIR=%HB_DIR_MYSQL%\bin set HB_ROOT=..\..\.. set HB_MAKEFILE=..\..\mtpl_b32.mak -set CFLAGS=-I"%HB_INC_MYSQL%";..\..\..\include +set CFLAGS=-I"%HB_INC_MYSQL%" rem --------------------------------------------------------------- diff --git a/harbour/contrib/rddsql/sddmy/make_vc.bat b/harbour/contrib/rddsql/sddmy/make_vc.bat index eead8665f0..850c15f9e2 100644 --- a/harbour/contrib/rddsql/sddmy/make_vc.bat +++ b/harbour/contrib/rddsql/sddmy/make_vc.bat @@ -20,8 +20,8 @@ goto POST_EXIT if "%HB_INC_MYSQL%" == "" set HB_INC_MYSQL=%HB_DIR_MYSQL%\include set _HB_DLL_NAME=libmySQL set HB_ROOT=..\..\.. -set HB_MAKEFILE=..\..\mtpl_b32.mak -set CFLAGS=-I"%HB_INC_MYSQL%";..\..\..\include +set HB_MAKEFILE=..\..\mtpl_vc.mak +set CFLAGS=-I"%HB_INC_MYSQL%" rem --------------------------------------------------------------- diff --git a/harbour/contrib/rddsql/sddpg/make_b32.bat b/harbour/contrib/rddsql/sddpg/make_b32.bat index 2840c18aac..94b2a1fdb3 100644 --- a/harbour/contrib/rddsql/sddpg/make_b32.bat +++ b/harbour/contrib/rddsql/sddpg/make_b32.bat @@ -21,7 +21,7 @@ if "%HB_INC_PGSQL%" == "" set HB_INC_PGSQL=%HB_DIR_PGSQL%\include set _HB_DLL_NAME=libpq set HB_ROOT=..\..\.. set HB_MAKEFILE=..\..\mtpl_b32.mak -set CFLAGS=-I"%HB_INC_PGSQL%";..\..\..\include +set CFLAGS=-I"%HB_INC_PGSQL%" rem --------------------------------------------------------------- diff --git a/harbour/contrib/rddsql/sddpg/make_vc.bat b/harbour/contrib/rddsql/sddpg/make_vc.bat index f7dc49033e..b38a57cf98 100644 --- a/harbour/contrib/rddsql/sddpg/make_vc.bat +++ b/harbour/contrib/rddsql/sddpg/make_vc.bat @@ -20,8 +20,8 @@ goto POST_EXIT if "%HB_INC_PGSQL%" == "" set HB_INC_PGSQL=%HB_DIR_PGSQL%\include set _HB_DLL_NAME=libpq set HB_ROOT=..\..\.. -set HB_MAKEFILE=..\..\mtpl_b32.mak -set CFLAGS=-I"%HB_INC_PGSQL%";..\..\..\include +set HB_MAKEFILE=..\..\mtpl_vc.mak +set CFLAGS=-I"%HB_INC_PGSQL%" rem --------------------------------------------------------------- diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index f50e1a2115..edde25e237 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -827,7 +827,11 @@ extern HB_EXPORT BOOL hb_compStrToNum( const char * szNum, ULONG ulLen, HB_ extern HB_EXPORT BOOL hb_valStrnToNum( const char * szNum, ULONG ulLen, HB_LONG * plVal, double * pdVal, int * piDec, int * piWidth ); /* converts string to number, sets iDec, iWidth and returns TRUE if results is double, used by VAL() */ extern HB_EXPORT BOOL hb_strToNum( const char * szNum, HB_LONG * plVal, double * pdVal ); /* converts string to number, returns TRUE if results is double */ extern HB_EXPORT BOOL hb_strnToNum( const char * szNum, ULONG ulLen, HB_LONG * plVal, double * pdVal ); /* converts string to number, returns TRUE if results is double */ +#if defined( HB__USE_OWN_SNPRINTF ) +extern HB_EXPORT int hb_snprintf( char * buffer, size_t bufsize, const char * format, ... ) HB_PRINTF_FORMAT( 3, 4 ); /* snprintf() equivalent */ +#else extern HB_EXPORT ULONG hb_snprintf( char * buffer, ULONG nSize, const char * format, ... ) HB_PRINTF_FORMAT( 3, 4 ); /* snprintf() wrapper */ +#endif extern HB_EXPORT BOOL hb_strMatchFile( const char * pszString, const char * szPattern ); /* compare two strings using platform dependent rules for file matching */ extern HB_EXPORT BOOL hb_strMatchRegExp( const char * szString, const char * szPattern ); /* compare two strings using a regular expression pattern */ diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index fb13ec2148..05e6c5cf20 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -55,6 +55,7 @@ #include +#define HB__USE_OWN_SNPRINTF /* temp, for initial live testing */ /* *********************************************************************** * Include settings common for .prg and .c files diff --git a/harbour/source/common/hbprintf.c b/harbour/source/common/hbprintf.c index d01fa4007d..e91ec4ee9d 100644 --- a/harbour/source/common/hbprintf.c +++ b/harbour/source/common/hbprintf.c @@ -50,8 +50,6 @@ * */ -#if 1 - /* patterm format: '%' [*] [] [.] [] @@ -102,6 +100,8 @@ optimized. #include "hbapi.h" #include "hbmath.h" +#if defined( HB__USE_OWN_SNPRINTF ) + #if defined( __BORLANDC__ ) || defined( __WATCOMC__ ) || defined( _MSC_VER ) # include #elif defined(__DJGPP__) @@ -110,13 +110,6 @@ optimized. # include /* for finite() */ #endif -HB_EXTERN_BEGIN - -int hb_snprintf_c( char *buffer, size_t bufsize, const char *format, ... ) - HB_PRINTF_FORMAT( 3, 4 ); - -HB_EXTERN_END - #if defined( HB_LONG_DOUBLE_OFF ) && !defined( __NO_LONGDOUBLE__ ) # define __NO_LONGDOUBLE__ #endif @@ -843,7 +836,7 @@ static size_t put_str( char *buffer, size_t bufsize, size_t size, return size; } -int hb_snprintf_c( char * buffer, size_t bufsize, const char * format, ... ) +int hb_snprintf( char * buffer, size_t bufsize, const char * format, ... ) { va_list args; size_t size; diff --git a/harbour/source/common/hbstr.c b/harbour/source/common/hbstr.c index dae2fdaa91..7e43ab53fb 100644 --- a/harbour/source/common/hbstr.c +++ b/harbour/source/common/hbstr.c @@ -1090,6 +1090,8 @@ char * hb_compDecodeString( int iMethod, const char * szText, ULONG * pulLen ) return pBuffer; } +#if ! defined( HB__USE_OWN_SNPRINTF ) + #undef _HB_SNPRINTF_ADD_EOS #undef hb_snprintf /* NOTE: The full size of the buffer is expected as nSize. [vszakats] */ @@ -1125,3 +1127,5 @@ ULONG hb_snprintf( char * buffer, ULONG nSize, const char * format, ... ) return result; } + +#endif diff --git a/harbour/source/lang/msgua866.c b/harbour/source/lang/msgua866.c index b24f445e39..1c5bf21748 100644 --- a/harbour/source/lang/msgua866.c +++ b/harbour/source/lang/msgua866.c @@ -56,12 +56,12 @@ #include "hbapilng.h" -static HB_LANG s_lang +static HB_LANG s_lang = { { /* Identification */ - "UAWIN", /* ID */ + "UA866", /* ID */ "Ukrainian", /* Name (in English) */ "쪠", /* Name (in native language) */ "UA", /* RFC ID */ @@ -93,7 +93,7 @@ static HB_LANG s_lang "'⭨", "㡮", - /* CA-Clipper compatible natmsg items */ + /* CA-Cl*pper compatible natmsg items */ " # ⠭ . ", " ਪ ?", @@ -194,26 +194,25 @@ static HB_LANG s_lang /* Texts */ - "//", + "MM/DD/YYYY", "", "" } }; -HB_LANG_ANNOUNCE( UAWIN ); +HB_LANG_ANNOUNCE( UA866 ); -HB_CALL_ON_STARTUP_BEGIN( hb_lang_Init_UAWIN ) +HB_CALL_ON_STARTUP_BEGIN( hb_lang_Init_UA866 ) hb_langRegister( &s_lang ); -HB_CALL_ON_STARTUP_END( hb_lang_Init_UAWIN ) +HB_CALL_ON_STARTUP_END( hb_lang_Init_UA866 ) #if defined( HB_PRAGMA_STARTUP ) - #pragma startup hb_lang_Init_UAWIN + #pragma startup hb_lang_Init_UA866 #elif defined( HB_MSC_STARTUP ) #if defined( HB_OS_WIN_64 ) #pragma section( HB_MSC_START_SEGMENT, long, read ) #endif #pragma data_seg( HB_MSC_START_SEGMENT ) - static HB_$INITSYM hb_vm_auto_hb_lang_Init_UAWIN hb_lang_Init_UAWIN; + static HB_$INITSYM hb_vm_auto_hb_lang_Init_UA866 = hb_lang_Init_UA866; #pragma data_seg() #endif - diff --git a/harbour/source/lang/msguakoi.c b/harbour/source/lang/msguakoi.c index 92eed663ea..27af79ff4d 100644 --- a/harbour/source/lang/msguakoi.c +++ b/harbour/source/lang/msguakoi.c @@ -56,12 +56,12 @@ #include "hbapilng.h" -static HB_LANG s_lang +static HB_LANG s_lang = { { /* Identification */ - "UAWIN", /* ID */ + "UAKOI8", /* ID */ "Ukrainian", /* Name (in English) */ "", /* Name (in native language) */ "UA", /* RFC ID */ @@ -93,7 +93,7 @@ static HB_LANG s_lang "?", "", - /* CA-Clipper compatible natmsg items */ + /* CA-Cl*pper compatible natmsg items */ " # . ͦ", "ҦΦ ?", @@ -194,26 +194,25 @@ static HB_LANG s_lang /* Texts */ - "//", + "MM/DD/YYYY", "", "" } }; -HB_LANG_ANNOUNCE( UAWIN ); +HB_LANG_ANNOUNCE( UAKOI8 ); -HB_CALL_ON_STARTUP_BEGIN( hb_lang_Init_UAWIN ) +HB_CALL_ON_STARTUP_BEGIN( hb_lang_Init_UAKOI8 ) hb_langRegister( &s_lang ); -HB_CALL_ON_STARTUP_END( hb_lang_Init_UAWIN ) +HB_CALL_ON_STARTUP_END( hb_lang_Init_UAKOI8 ) #if defined( HB_PRAGMA_STARTUP ) - #pragma startup hb_lang_Init_UAWIN + #pragma startup hb_lang_Init_UAKOI8 #elif defined( HB_MSC_STARTUP ) #if defined( HB_OS_WIN_64 ) #pragma section( HB_MSC_START_SEGMENT, long, read ) #endif #pragma data_seg( HB_MSC_START_SEGMENT ) - static HB_$INITSYM hb_vm_auto_hb_lang_Init_UAWIN hb_lang_Init_UAWIN; + static HB_$INITSYM hb_vm_auto_hb_lang_Init_UAKOI8 = hb_lang_Init_UAKOI8; #pragma data_seg() #endif - diff --git a/harbour/source/lang/msguawin.c b/harbour/source/lang/msguawin.c index 7bd32ba91b..2ddc7740b5 100644 --- a/harbour/source/lang/msguawin.c +++ b/harbour/source/lang/msguawin.c @@ -93,7 +93,7 @@ static HB_LANG s_lang = "ϒ", "", - /* CA-Clipper compatible natmsg items */ + /* CA-Cl*pper compatible natmsg items */ " # . ", " ?", @@ -194,7 +194,7 @@ static HB_LANG s_lang = /* Texts */ - "//", + "MM/DD/YYYY", "", "" } @@ -216,4 +216,3 @@ HB_CALL_ON_STARTUP_END( hb_lang_Init_UAWIN ) static HB_$INITSYM hb_vm_auto_hb_lang_Init_UAWIN = hb_lang_Init_UAWIN; #pragma data_seg() #endif - diff --git a/harbour/source/vm/maindllp.c b/harbour/source/vm/maindllp.c index 317730a386..7a35b6763e 100644 --- a/harbour/source/vm/maindllp.c +++ b/harbour/source/vm/maindllp.c @@ -61,9 +61,9 @@ #define HB_DLL_NAME "harbour.dll" #if defined( __BORLANDC__ ) -#define HB_DLL_NAME2 "harbour-b32.dll" +#define HB_DLL_NAME2 "harbour-11-b32.dll" #elif defined( _MSC_VER ) -#define HB_DLL_NAME2 "harbour-vc.dll" +#define HB_DLL_NAME2 "harbour-11-vc.dll" #endif #if defined(HB_OS_WIN)