diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b1705e22f0..43c633a8b3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,31 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-06-01 21:40 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/vm/fm.c + * src/vm/set.c + * SET( _SET_HBOUTLOG, NIL ) will now reset the internal output + name to NULL, which is also the new internal default value. + * After this change the GPF handler and FM STAT dump code + will do the defaulting to "hb_out.log" filename, if the + internal _SET_HBOUTLOG value is NULL. This causes a small + incompatibility in how log file can be disabled, and at the + same time allows to implement low-level logging logic for + default case which is safer than current one, while allowing + the user (developer) to set a custom log filename and expect + regular log file append behavior. + From now on to disable logging, use: SET( _SET_HBOUTLOG ) + + * utils/hbmk2/hbmk2.prg + ! Fixed to not do pkg detection and key header evaluation + after -stop and certain modes. + + Added full list of std C and POSIX headers to the header + exclusion list in header dependency parser code. + Also added dos.h. + + * contrib/xhb/dbgfxc.c + * Formatting. + 2010-06-01 01:46 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + Will now ignore current and host directory when looking @@ -36,7 +61,7 @@ + Added new hbmk2 make files. * contrib/hbgd/Makefile - - Deleted some information from cmoment. (now included in INSTALL) + - Deleted some information from comment. (now included in INSTALL) * contrib/hbcairo/hbcairo.h * Formatting. diff --git a/harbour/contrib/xhb/dbgfxc.c b/harbour/contrib/xhb/dbgfxc.c index 702f72aada..b552192550 100644 --- a/harbour/contrib/xhb/dbgfxc.c +++ b/harbour/contrib/xhb/dbgfxc.c @@ -72,14 +72,14 @@ void hb_ToOutDebug( const char * sTraceMsg, ... ) { if( sTraceMsg && s_bToOutputDebug ) { - char buffer[ 1024 ]; - va_list ap; + char buffer[ 1024 ]; + va_list ap; - va_start( ap, sTraceMsg ); - hb_vsnprintf( buffer, sizeof( buffer ), sTraceMsg, ap ); - va_end( ap ); + va_start( ap, sTraceMsg ); + hb_vsnprintf( buffer, sizeof( buffer ), sTraceMsg, ap ); + va_end( ap ); - hb_OutDebug( ( const char * ) buffer, ( HB_SIZE ) strlen( buffer ) ); + hb_OutDebug( ( const char * ) buffer, ( HB_SIZE ) strlen( buffer ) ); } } diff --git a/harbour/src/vm/fm.c b/harbour/src/vm/fm.c index 3f94d48889..f464456bf5 100644 --- a/harbour/src/vm/fm.c +++ b/harbour/src/vm/fm.c @@ -550,7 +550,10 @@ void hb_xclean( void ) void hb_xsetfilename( const char * szValue ) { #ifdef HB_FM_STATISTICS - hb_strncpy( s_szFileName, szValue, sizeof( s_szFileName ) - 1 ); + if( szValue ) + hb_strncpy( s_szFileName, szValue, sizeof( s_szFileName ) - 1 ); + else + s_szFileName[ 0 ] = '\0'; #else HB_SYMBOL_UNUSED( szValue ); #endif @@ -1108,8 +1111,8 @@ void hb_xexit( void ) /* Deinitialize fixed memory subsystem */ char buffer[ 100 ]; FILE * hLog = NULL; - if( s_lMemoryBlocks && s_szFileName[ 0 ] ) - hLog = hb_fopen( s_szFileName, "a+" ); + if( s_lMemoryBlocks ) + hLog = hb_fopen( s_szFileName[ 0 ] ? s_szFileName : "hb_out.log", "a+" ); hb_conOutErr( hb_conNewLine(), 0 ); hb_conOutErr( "----------------------------------------", 0 ); diff --git a/harbour/src/vm/set.c b/harbour/src/vm/set.c index 1c88dc40c7..daca8a2fa9 100644 --- a/harbour/src/vm/set.c +++ b/harbour/src/vm/set.c @@ -963,9 +963,15 @@ HB_FUNC( SET ) break; case HB_SET_HBOUTLOG: hb_retc( pSet->HB_SET_HBOUTLOG ); - if( args > 1 ) + if( args > 1 && ( HB_IS_STRING( pArg2 ) || HB_IS_NIL( pArg2 ) ) ) { - pSet->HB_SET_HBOUTLOG = set_string( pArg2, pSet->HB_SET_HBOUTLOG ); + if( pSet->HB_SET_HBOUTLOG ) + hb_xfree( pSet->HB_SET_HBOUTLOG ); + if( HB_IS_NIL( pArg2 ) ) + pSet->HB_SET_HBOUTLOG = NULL; + else + /* Limit size of SET strings to 64K, truncating if source is longer */ + pSet->HB_SET_HBOUTLOG = hb_strndup( hb_itemGetCPtr( pArg2 ), USHRT_MAX ); hb_xsetfilename( pSet->HB_SET_HBOUTLOG ); } break; @@ -1109,7 +1115,7 @@ void hb_setInitialize( PHB_SET_STRUCT pSet ) pSet->HB_SET_DEFEXTENSIONS = HB_TRUE; pSet->HB_SET_EOL = hb_strdup( hb_conNewLine() ); pSet->HB_SET_TRIMFILENAME = HB_FALSE; - pSet->HB_SET_HBOUTLOG = hb_strdup( "hb_out.log" ); + pSet->HB_SET_HBOUTLOG = NULL; pSet->HB_SET_HBOUTLOGINFO = hb_strdup( "" ); pSet->HB_SET_OSCODEPAGE = NULL; pSet->HB_SET_DBCODEPAGE = NULL; @@ -1809,7 +1815,10 @@ HB_BOOL hb_setSetItem( HB_set_enum set_specifier, PHB_ITEM pItem ) case HB_SET_HBOUTLOG: if( HB_IS_STRING( pItem ) || HB_IS_NIL( pItem ) ) { - szValue = hb_strndup( hb_itemGetCPtr( pItem ), USHRT_MAX ); + if( HB_IS_NIL( pItem ) ) + szValue = NULL; + else + szValue = hb_strndup( hb_itemGetCPtr( pItem ), USHRT_MAX ); if( pSet->HB_SET_HBOUTLOG ) hb_xfree( pSet->HB_SET_HBOUTLOG ); pSet->HB_SET_HBOUTLOG = szValue; diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 017e6a5a23..dc6726aa33 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -2391,10 +2391,12 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) ENDIF ENDIF - /* Process any package requirements */ - FOR EACH tmp IN hbmk[ _HBMK_aREQPKG ] - pkg_try_detection( hbmk, tmp ) - NEXT + IF ! lStopAfterInit .AND. ! lStopAfterHarbour + /* Process any package requirements */ + FOR EACH tmp IN hbmk[ _HBMK_aREQPKG ] + pkg_try_detection( hbmk, tmp ) + NEXT + ENDIF IF ( ! lStopAfterInit .AND. ! lStopAfterHarbour ) .OR. hbmk[ _HBMK_lCreateImpLib ] @@ -4015,26 +4017,28 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) /* Check if we've found all key headers */ - tmp1 := {} - FOR EACH tmp IN hbmk[ _HBMK_hKEYHEADER ] - IF tmp == NIL - AAdd( tmp1, tmp:__enumKey() ) - IF hbmk[ _HBMK_lDEBUGINC ] - hbmk_OutStd( hbmk, hb_StrFormat( "debuginc: KEYHEADER %1$s: missing", tmp:__enumKey() ) ) + IF ! lSkipBuild .AND. ! lStopAfterInit .AND. ! lStopAfterHarbour + tmp1 := {} + FOR EACH tmp IN hbmk[ _HBMK_hKEYHEADER ] + IF tmp == NIL + AAdd( tmp1, tmp:__enumKey() ) + IF hbmk[ _HBMK_lDEBUGINC ] + hbmk_OutStd( hbmk, hb_StrFormat( "debuginc: KEYHEADER %1$s: missing", tmp:__enumKey() ) ) + ENDIF + ELSE + IF hbmk[ _HBMK_lDEBUGINC ] + hbmk_OutStd( hbmk, hb_StrFormat( "debuginc: KEYHEADER %1$s %2$s", tmp:__enumKey(), tmp ) ) + ENDIF ENDIF - ELSE - IF hbmk[ _HBMK_lDEBUGINC ] - hbmk_OutStd( hbmk, hb_StrFormat( "debuginc: KEYHEADER %1$s %2$s", tmp:__enumKey(), tmp ) ) - ENDIF - ENDIF - NEXT + NEXT - IF ! Empty( tmp1 ) - hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Missing header dependency: %1$s" ), ArrayToList( tmp1, ", " ) ) ) - IF hbmk[ _HBMK_lBEEP ] - DoBeep( .F. ) + IF ! Empty( tmp1 ) + hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Missing header dependency: %1$s" ), ArrayToList( tmp1, ", " ) ) ) + IF hbmk[ _HBMK_lBEEP ] + DoBeep( .F. ) + ENDIF + RETURN 10 ENDIF - RETURN 10 ENDIF /* Harbour compilation */ @@ -5488,14 +5492,106 @@ STATIC FUNCTION FindNewerHeaders( hbmk, cFileName, cParentDir, lSystemHeader, tT LOCAL tTimeSelf LOCAL tTimeDependency LOCAL tmp - LOCAL cNameExtL LOCAL cExt LOCAL cHeader LOCAL cModule LOCAL cDependency LOCAL aCommand - STATIC l_aExcl := { "windows.h", "ole2.h", "os2.h" } + STATIC s_hExclStd := NIL + + IF s_hExclStd == NIL + s_hExclStd := {; + "assert.h" => NIL ,; /* Standard C */ + "ctype.h" => NIL ,; + "errno.h" => NIL ,; + "float.h" => NIL ,; + "limits.h" => NIL ,; + "locale.h" => NIL ,; + "math.h" => NIL ,; + "setjmp.h" => NIL ,; + "signal.h" => NIL ,; + "stdarg.h" => NIL ,; + "stddef.h" => NIL ,; + "stdio.h" => NIL ,; + "stdlib.h" => NIL ,; + "string.h" => NIL ,; + "time.h" => NIL ,; + "iso646.h" => NIL ,; /* ISO C NA1 */ + "wchar.h" => NIL ,; + "wctype.h" => NIL ,; + "complex.h" => NIL ,; /* ISO C C99 */ + "fenv.h" => NIL ,; + "inttypes.h" => NIL ,; + "stdbool.h" => NIL ,; + "stdint.h" => NIL ,; + "tgmath.h" => NIL ,; + "unistd.h" => NIL ,; /* Standard C POSIX */ + "aio.h" => NIL ,; + "arpa/inet.h" => NIL ,; + "cpio.h" => NIL ,; + "dirent.h" => NIL ,; + "dlfcn.h" => NIL ,; + "fcntl.h" => NIL ,; + "fmtmsg.h" => NIL ,; + "fnmatch.h" => NIL ,; + "ftw.h" => NIL ,; + "glob.h" => NIL ,; + "grp.h" => NIL ,; + "iconv.h" => NIL ,; + "langinfo.h" => NIL ,; + "libgen.h" => NIL ,; + "monetary.h" => NIL ,; + "mqueue.h" => NIL ,; + "ndbm.h" => NIL ,; + "net/if.h" => NIL ,; + "netdb.h" => NIL ,; + "netinet/in.h" => NIL ,; + "netinet/tcp.h" => NIL ,; + "nl_types.h" => NIL ,; + "poll.h" => NIL ,; + "pthread.h" => NIL ,; + "pwd.h" => NIL ,; + "regex.h" => NIL ,; + "sched.h" => NIL ,; + "search.h" => NIL ,; + "semaphore.h" => NIL ,; + "spawn.h" => NIL ,; + "strings.h" => NIL ,; + "stropts.h" => NIL ,; + "sys/ipc.h" => NIL ,; + "sys/mman.h" => NIL ,; + "sys/msg.h" => NIL ,; + "sys/resource.h" => NIL ,; + "sys/select.h" => NIL ,; + "sys/sem.h" => NIL ,; + "sys/shm.h" => NIL ,; + "sys/socket.h" => NIL ,; + "sys/stat.h" => NIL ,; + "sys/statvfs.h" => NIL ,; + "sys/time.h" => NIL ,; + "sys/times.h" => NIL ,; + "sys/types.h" => NIL ,; + "sys/uio.h" => NIL ,; + "sys/un.h" => NIL ,; + "sys/utsname.h" => NIL ,; + "sys/wait.h" => NIL ,; + "syslog.h" => NIL ,; + "tar.h" => NIL ,; + "termios.h" => NIL ,; + "trace.h" => NIL ,; + "ulimit.h" => NIL ,; + "unistd.h" => NIL ,; + "utime.h" => NIL ,; + "utmpx.h" => NIL ,; + "wordexp.h" => NIL ,; + "windows.h" => NIL ,; /* OS (win) */ + "winspool.h" => NIL ,; + "shellapi.h" => NIL ,; + "ole2.h" => NIL ,; + "dos.h" => NIL ,; /* OS (dos) */ + "os2.h" => NIL } /* OS (os2) */ + ENDIF DEFAULT nNestingLevel TO 1 DEFAULT cParentDir TO FN_DirGet( cFileName ) @@ -5514,9 +5610,8 @@ STATIC FUNCTION FindNewerHeaders( hbmk, cFileName, cParentDir, lSystemHeader, tT RETURN .F. ENDIF - /* Don't spend time on some known headers */ - cNameExtL := Lower( FN_NameExtGet( cFileName ) ) - IF AScan( l_aExcl, { |tmp| Lower( tmp ) == cNameExtL } ) > 0 + /* Don't spend time on known headers */ + IF StrTran( Lower( cFileName ), "\", "/" ) $ s_hExclStd RETURN .F. ENDIF