From d2f974642f11f0ebd91fd0a0045de1900bfa051e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 26 Aug 2008 20:15:41 +0000 Subject: [PATCH] 2008-08-26 22:13 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * source/common/hbver.c * hb_verCompiler() buffer size cleanup. * source/rtl/hbinet.c * Minor formatting. * utils/hbmake/hbmake.prg * PRG -> .prg on some screen messages. * config/w32/xcc.cf * config/w32/pocc.cf + Added ws2_32.lib. Didn't solve the problem, but as per MS docs of some functions we use, we should use this instead of wsock2 (everywhere actually) [and ws2 instead of winsock for WinCE]. Someone pls correct me if I'm wrong, or if there is any reason we're using both and/or the older one? * config/w32/pocc.cf - Removed C switch -Zx (Enable Pelles C extensions). We don't need this. --- harbour/ChangeLog | 23 ++++++++++++++++++ harbour/config/w32/pocc.cf | 4 ++-- harbour/config/w32/xcc.cf | 2 +- harbour/source/common/hbver.c | 20 ++++++++-------- harbour/source/rtl/hbinet.c | 6 ++--- harbour/utils/hbmake/hbmake.prg | 42 ++++++++++++++++----------------- 6 files changed, 60 insertions(+), 37 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1164106a65..0cf50ec88e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,29 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-08-26 22:13 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * source/common/hbver.c + * hb_verCompiler() buffer size cleanup. + + * source/rtl/hbinet.c + * Minor formatting. + + * utils/hbmake/hbmake.prg + * PRG -> .prg on some screen messages. + + * config/w32/xcc.cf + * config/w32/pocc.cf + + Added ws2_32.lib. Didn't solve the problem, but + as per MS docs of some functions we use, we should + use this instead of wsock2 (everywhere actually) + [and ws2 instead of winsock for WinCE]. Someone pls + correct me if I'm wrong, or if there is any reason + we're using both and/or the older one? + + * config/w32/pocc.cf + - Removed C switch -Zx (Enable Pelles C extensions). + We don't need this. + 2008-08-26 15:14 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * source/common/hbver.c + Show bitness for all (non-DJGPP) compilers. diff --git a/harbour/config/w32/pocc.cf b/harbour/config/w32/pocc.cf index 2655325142..6ff085a379 100644 --- a/harbour/config/w32/pocc.cf +++ b/harbour/config/w32/pocc.cf @@ -16,7 +16,7 @@ CC_IN = -c CC_OUT = -Fo CPPFLAGS = -I. -CPPFLAGS += -Ze -Zx -Go +CPPFLAGS += -Ze -Go # optimizations CPPFLAGS += -Ot -Ox @@ -55,7 +55,7 @@ ifeq ($(findstring rtl,$(LIBS)),rtl) LINKLIBS += $(foreach gt, $(HB_GT_LIBS), $(gt)$(LIB_EXT)) endif -LDFLAGS = $(LINKPATHS) kernel32.lib user32.lib gdi32.lib wsock32.lib advapi32.lib +LDFLAGS = $(LINKPATHS) kernel32.lib user32.lib gdi32.lib wsock32.lib ws2_32.lib advapi32.lib LDFLAGS += winspool.lib ole32.lib oleaut32.lib uuid.lib \ comctl32.lib mapi32.lib mpr.lib diff --git a/harbour/config/w32/xcc.cf b/harbour/config/w32/xcc.cf index d8505edb41..d5635fc2bc 100644 --- a/harbour/config/w32/xcc.cf +++ b/harbour/config/w32/xcc.cf @@ -45,7 +45,7 @@ ifeq ($(findstring rtl,$(LIBS)),rtl) LINKLIBS += $(foreach gt, $(HB_GT_LIBS), $(gt)$(LIB_EXT)) endif -LDFLAGS = $(LINKPATHS) kernel32.lib user32.lib gdi32.lib wsock32.lib advapi32.lib +LDFLAGS = $(LINKPATHS) kernel32.lib user32.lib gdi32.lib wsock32.lib ws2_32.lib advapi32.lib LDFLAGS += winspool.lib ole32.lib oleaut32.lib uuid.lib \ comctl32.lib mapi32.lib mpr.lib diff --git a/harbour/source/common/hbver.c b/harbour/source/common/hbver.c index 7bd2b6ae11..1847ec19ec 100644 --- a/harbour/source/common/hbver.c +++ b/harbour/source/common/hbver.c @@ -341,7 +341,7 @@ HB_EXPORT BOOL hb_iswince( void ) /* NOTE: The caller must free the returned buffer. [vszakats] */ -#define COMPILER_BUF_SIZE 79 +#define COMPILER_BUF_SIZE 80 char * hb_verCompiler( void ) { @@ -354,7 +354,7 @@ char * hb_verCompiler( void ) HB_TRACE(HB_TR_DEBUG, ("hb_verCompiler()")); - pszCompiler = ( char * ) hb_xgrab( COMPILER_BUF_SIZE + 1 ); + pszCompiler = ( char * ) hb_xgrab( COMPILER_BUF_SIZE ); szSub[ 0 ] = '\0'; #if defined(__IBMC__) || defined(__IBMCPP__) @@ -514,28 +514,28 @@ char * hb_verCompiler( void ) if( pszName ) { if( iVerPatch != 0 ) - snprintf( pszCompiler, 80, "%s%s %hd.%hd.%hd", pszName, szSub, iVerMajor, iVerMinor, iVerPatch ); + snprintf( pszCompiler, COMPILER_BUF_SIZE, "%s%s %hd.%hd.%hd", pszName, szSub, iVerMajor, iVerMinor, iVerPatch ); else if( iVerMajor != 0 || iVerMinor != 0 ) - snprintf( pszCompiler, 80, "%s%s %hd.%hd", pszName, szSub, iVerMajor, iVerMinor ); + snprintf( pszCompiler, COMPILER_BUF_SIZE, "%s%s %hd.%hd", pszName, szSub, iVerMajor, iVerMinor ); else - snprintf( pszCompiler, 80, "%s%s", pszName, szSub ); + snprintf( pszCompiler, COMPILER_BUF_SIZE, "%s%s", pszName, szSub ); } else - hb_strncpy( pszCompiler, "(unknown)", COMPILER_BUF_SIZE ); + hb_strncpy( pszCompiler, "(unknown)", COMPILER_BUF_SIZE - 1 ); #if defined(__DJGPP__) snprintf( szSub, sizeof( szSub ), " (DJGPP %i.%02i)", ( int ) __DJGPP__, ( int ) __DJGPP_MINOR__ ); - hb_strncat( pszCompiler, szSub, COMPILER_BUF_SIZE ); + hb_strncat( pszCompiler, szSub, COMPILER_BUF_SIZE - 1 ); #else #if defined( HB_ARCH_16BIT ) - hb_strncat( pszCompiler, " (16 bit)", COMPILER_BUF_SIZE ); + hb_strncat( pszCompiler, " (16 bit)", COMPILER_BUF_SIZE - 1 ); #elif defined( HB_ARCH_32BIT ) - hb_strncat( pszCompiler, " (32 bit)", COMPILER_BUF_SIZE ); + hb_strncat( pszCompiler, " (32 bit)", COMPILER_BUF_SIZE - 1 ); #elif defined( HB_ARCH_64BIT ) - hb_strncat( pszCompiler, " (64 bit)", COMPILER_BUF_SIZE ); + hb_strncat( pszCompiler, " (64 bit)", COMPILER_BUF_SIZE - 1 ); #endif #endif diff --git a/harbour/source/rtl/hbinet.c b/harbour/source/rtl/hbinet.c index 35146a6d45..f1db15e6dc 100644 --- a/harbour/source/rtl/hbinet.c +++ b/harbour/source/rtl/hbinet.c @@ -66,7 +66,7 @@ /* Compile in Unix mode under Cygwin */ #ifdef HB_OS_UNIX_COMPATIBLE - #undef HB_OS_WIN_32 + #undef HB_OS_WIN_32 #endif /* HB_INET_H_ */ @@ -81,7 +81,7 @@ #include #if defined( HB_OS_WIN_32 ) - #define _WINSOCKAPI_ /* Prevents inclusion of Winsock.h in Windows.h */ + #define _WINSOCKAPI_ /* Prevents inclusion of winsock.h in windows.h */ #define HB_SOCKET_T SOCKET #include #include @@ -330,7 +330,7 @@ static struct hostent * hb_getHosts( char * name, HB_SOCKET_STRUCT *Socket ) /* TOFIX: make it MT safe */ - /* let's see if name is an IP address; not necessary on linux */ + /* let's see if name is an IP address; not necessary on Linux */ #if defined(HB_OS_WIN_32) || defined(HB_OS_OS2) ULONG ulAddr; diff --git a/harbour/utils/hbmake/hbmake.prg b/harbour/utils/hbmake/hbmake.prg index 54db48e8c6..6e563b1568 100644 --- a/harbour/utils/hbmake/hbmake.prg +++ b/harbour/utils/hbmake/hbmake.prg @@ -2409,7 +2409,7 @@ Endif // Create and compile ENDIF - // Selecting PRG files. + // Selecting .prg files. aInFiles := GetSourceFiles( s_lRecursive, s_lGcc, cOS ) nLenaSrc := Len( aInFiles ) @@ -2443,11 +2443,11 @@ Endif // Create and compile Attention( s_aLangMessages[ 41 ], 22 ) if s_nlang == 1 - s_cAlertMsg := "Selecione os PRGs a compilar" + s_cAlertMsg := "Selecione os .prgs a compilar" elseif s_nlang == 3 - s_cAlertMsg := "Seleccione los PRG a compilar" + s_cAlertMsg := "Seleccione los .prg a compilar" else - s_cAlertMsg := "Select the PRG files to compile" + s_cAlertMsg := "Select the .prg files to compile" endif @@ -2484,11 +2484,11 @@ Endif // Create and compile cTopFile := "" IF s_nlang == 1 // PT - s_cAlertMsg := "Nenhum PRG foi selecionado." + s_cAlertMsg := "Nenhum .prg foi selecionado." ELSEIF s_nlang == 3 - s_cAlertMsg := "Ning£m PRG foi seleccionado." + s_cAlertMsg := "Ning£m .prg foi seleccionado." ELSE - s_cAlertMsg := "No one PRG were selected." + s_cAlertMsg := "No .prg files were selected." ENDIF Alert( s_cAlertMsg ) @@ -2501,11 +2501,11 @@ Endif // Create and compile IF !lCreateAndCompile IF s_nlang == 1 // PT - s_cAlertMsg := "Informe o PRG principal da sua aplica‡Æo:" + s_cAlertMsg := "Informe o .prg principal da sua aplica‡Æo:" ELSEIF s_nlang == 3 - s_cAlertMsg := "Informe o PRG principale de su aplicacion:" + s_cAlertMsg := "Informe o .prg principale de su aplicacion:" ELSE - s_cAlertMsg := "Inform the main PRG of your application:" + s_cAlertMsg := "Inform the main .prg of your application:" ENDIF @ 15,01 say s_cAlertMsg Get cTopFile pict "@S35" valid !empty(cTopFile) @@ -2527,11 +2527,11 @@ Endif // Create and compile IF ! File( alltrim(cTopFile) ) IF s_nLang == 1 // PT - s_cAlertMsg := "Arquivo "+alltrim(cTopFile)+" nÆo encontrado."+iif(s_lRecursive," O flag -r est  ativo. Informe o subdir tamb‚m se o PRG principal estiver dentro dele.","") + s_cAlertMsg := "Arquivo "+alltrim(cTopFile)+" nÆo encontrado."+iif(s_lRecursive," O flag -r est  ativo. Informe o subdir tamb‚m se o .prg principal estiver dentro dele.","") ELSEIF s_nLang == 3 - s_cAlertMsg := "Fichero "+alltrim(cTopFile)+" no encontrado."+iif(s_lRecursive," Lo flag -r esta activado. Informe lo subdir tambi‚n si lo PRG principale est s dentro dele.","") + s_cAlertMsg := "Fichero "+alltrim(cTopFile)+" no encontrado."+iif(s_lRecursive," Lo flag -r esta activado. Informe lo subdir tambi‚n si lo .prg principale est s dentro dele.","") ELSE - s_cAlertMsg := "File "+alltrim(cTopFile)+" not found."+iif(s_lRecursive," The flag -r is active. Inform the subdir also if the main PRG is within it.","") + s_cAlertMsg := "File "+alltrim(cTopFile)+" not found."+iif(s_lRecursive," The flag -r is active. Inform the subdir also if the main .prg is within it.","") ENDIF Alert( s_cAlertMsg ) @@ -3240,11 +3240,11 @@ Endif // Create and compile ELSE IF s_nLang == 1 - s_cAlertMsg := "For‡ar recompila‡Æo para todos PRGs ? (S/N) " + s_cAlertMsg := "For‡ar recompila‡Æo para todos .prgs ? (S/N) " ELSEIF s_nLang == 3 // Spanish - s_cAlertMsg := "Forzar recompilaci¢n para todos los PRGs ? (S/N) " + s_cAlertMsg := "Forzar recompilaci¢n para todos los .prgs ? (S/N) " ELSE // English - s_cAlertMsg := "Force recompiling for all PRGs ? (Y/N) " + s_cAlertMsg := "Force recompiling for all .prgs ? (Y/N) " ENDIF @ 21,5 SAY s_cAlertMsg; @@ -4329,11 +4329,11 @@ FUNCTION CreateLibMakeFile( cFile ) if s_nlang == 1 - s_cAlertMsg := "Selecione os PRGs a compilar" + s_cAlertMsg := "Selecione os .prgs a compilar" elseif s_nlang == 3 - s_cAlertMsg := "Seleccione los PRG a compilar" + s_cAlertMsg := "Seleccione los .prg a compilar" else - s_cAlertMsg := "Select the PRG files to compile" + s_cAlertMsg := "Select the .prg files to compile" endif aInFiles := GetSourceFiles( s_lRecursive, s_lGcc, cOS ) @@ -5617,7 +5617,7 @@ LOCAL aLang := Array( 67 ) aLang[40] := "Usar libs externas" aLang[41] := "-Seleccionar -Continuar proceso Selec/Deselec todo." aLang[42] := "Nivel del aviso de lo compilador /w" - aLang[43] := "Cuantos PRGs por linea no makefile:" + aLang[43] := "Cuantos .prgs por linea no makefile:" aLang[44] := "Usar la libreria Multi Thread" aLang[45] := "Nombre del ejecutable" aLang[46] := "Nivel de Avisos /w" @@ -5689,7 +5689,7 @@ LOCAL aLang := Array( 67 ) aLang[40] := "Usa Libs Externas ?" aLang[41] := "-Seleciona p/ continuar processo -Sel/DeSel. tudo." aLang[42] := "N¡vel de aviso do compilador /w" - aLang[43] := "Qtd de PRGs por linha, no makefile: " + aLang[43] := "Qtd de .prgs por linha, no makefile: " aLang[44] := "Usar a biblioteca Multi Thread ?" aLang[45] := "Nome Execut vel:" aLang[46] := "N¡vel de Warnings /w"