2008-09-14 16:10 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* bin/hb-func.sh
  * source/vm/hvm.c
  * source/rtl/hbgtcore.c
  * source/rtl/gtchrmap.c
    ! Global vars given std names:
      s_pszLinkedMain        -> hb_vm_pszLinkedMain
      s_defaultGT            -> hb_gt_szNameDefault
      s_szDefaultCharMapFile -> hb_gt_szCharMapFileDefault
This commit is contained in:
Viktor Szakats
2008-09-14 14:11:27 +00:00
parent 96dd4b861f
commit ce6fc90ab4
5 changed files with 34 additions and 34 deletions

View File

@@ -8,6 +8,16 @@
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2008-09-14 16:10 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* bin/hb-func.sh
* source/vm/hvm.c
* source/rtl/hbgtcore.c
* source/rtl/gtchrmap.c
! Global vars given std names:
s_pszLinkedMain -> hb_vm_pszLinkedMain
s_defaultGT -> hb_gt_szNameDefault
s_szDefaultCharMapFile -> hb_gt_szCharMapFileDefault
2008-09-14 15:56 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbsetup.ch
* Turned off HB_LEGACY_LEVEL by default.

View File

@@ -596,15 +596,15 @@ hb_lnk_request()
if [ -n "\$gt" ] || [ -n "\${HB_MAIN_FUNC}" ]; then
echo "#include \\"hbinit.h\\""
echo "HB_EXTERN_BEGIN"
echo "extern \${HB_LNK_ATTR} const char * s_defaultGT;"
echo "extern \${HB_LNK_ATTR} const char * s_pszLinkedMain;"
echo "extern \${HB_LNK_ATTR} const char * hb_gt_szNameDefault;"
echo "extern \${HB_LNK_ATTR} const char * hb_vm_pszLinkedMain;"
echo "HB_EXTERN_END"
echo "HB_CALL_ON_STARTUP_BEGIN( hb_lnk_SetDefault_build )"
if [ -n "\$gt" ]; then
echo " s_defaultGT = \\"\$gt\\";"
echo " hb_gt_szNameDefault = \\"\$gt\\";"
fi
if [ -n "\${HB_MAIN_FUNC}" ]; then
echo " s_pszLinkedMain = \\"\${HB_MAIN_FUNC}\\";"
echo " hb_vm_pszLinkedMain = \\"\${HB_MAIN_FUNC}\\";"
fi
echo "HB_CALL_ON_STARTUP_END( hb_lnk_SetDefault_build )"
fi

View File

@@ -62,11 +62,7 @@
#define MAX_CHAR_VAL 0xff
#define HB_CHRMAP(a,c) ( ( (a) << 16 ) | (c) )
/* TOFIX: s_szDefaultCharMapFile is violating namespace, so it should be
renamed to hb_gt_szCharMapFileDefault, or wrapped into an
official API ASAP. [vszakats] */
char * s_szDefaultCharMapFile = "/etc/harbour/hb-charmap.def";
char * hb_gt_szCharMapFileDefault = "/etc/harbour/hb-charmap.def";
static void chrmap_init( int *piTransTbl )
{
@@ -432,17 +428,17 @@ int hb_gt_chrmapinit( int *piTransTbl, const char *pszTerm, BOOL fSetACSC )
hb_xfree( pszFile );
pszFile = hb_getenv( "HB_ROOT" );
if( pszFile != NULL && sizeof( szFile ) >
strlen( pszFile ) + strlen( s_szDefaultCharMapFile ) )
strlen( pszFile ) + strlen( hb_gt_szCharMapFileDefault ) )
{
hb_strncpy( szFile, pszFile, sizeof( szFile ) - 1 );
hb_strncat( szFile, s_szDefaultCharMapFile, sizeof( szFile ) - 1 );
hb_strncat( szFile, hb_gt_szCharMapFileDefault, sizeof( szFile ) - 1 );
nRet = hb_gt_chrmapread( szFile, pszTerm, piTransTbl );
}
}
if( pszFile )
hb_xfree( pszFile );
if( nRet == -1 )
nRet = hb_gt_chrmapread( s_szDefaultCharMapFile, pszTerm, piTransTbl );
nRet = hb_gt_chrmapread( hb_gt_szCharMapFileDefault, pszTerm, piTransTbl );
}
if( pszFree )

View File

@@ -3026,23 +3026,20 @@ static HB_GT_FUNCS s_gtCoreFunc =
static char s_gtNameBuf[ HB_GT_NAME_MAX_ + 1 ];
/* TOFIX: s_defaultGT is violating namespace, so it should be
renamed to hb_gt_szNameDefault ASAP. [vszakats] */
#if defined(HB_GT_DEFAULT)
HB_EXPORT const char * s_defaultGT = HB_GT_DRVNAME( HB_GT_DEFAULT );
HB_EXPORT const char * hb_gt_szNameDefault = HB_GT_DRVNAME( HB_GT_DEFAULT );
#elif defined(HB_GT_LIB)
HB_EXPORT const char * s_defaultGT = HB_GT_DRVNAME( HB_GT_LIB );
HB_EXPORT const char * hb_gt_szNameDefault = HB_GT_DRVNAME( HB_GT_LIB );
#elif defined(HB_OS_LINUX)
HB_EXPORT const char * s_defaultGT = "crs";
HB_EXPORT const char * hb_gt_szNameDefault = "crs";
#elif defined(HB_OS_WIN_32)
HB_EXPORT const char * s_defaultGT = "win";
HB_EXPORT const char * hb_gt_szNameDefault = "win";
#elif defined(HB_OS_DOS)
HB_EXPORT const char * s_defaultGT = "dos";
HB_EXPORT const char * hb_gt_szNameDefault = "dos";
#elif defined(HB_OS_OS2)
HB_EXPORT const char * s_defaultGT = "os2";
HB_EXPORT const char * hb_gt_szNameDefault = "os2";
#else
HB_EXPORT const char * s_defaultGT = "std";
HB_EXPORT const char * hb_gt_szNameDefault = "std";
#endif
static const HB_GT_INIT * s_gtInit[ HB_GT_MAX_ ];
@@ -3089,7 +3086,7 @@ static int hb_gt_FindEntry( const char * pszID )
HB_EXPORT void hb_gtSetDefault( const char * szGtName )
{
hb_strncpy( s_gtNameBuf, szGtName, sizeof( s_gtNameBuf ) - 1 );
s_defaultGT = s_gtNameBuf;
hb_gt_szNameDefault = s_gtNameBuf;
}
HB_EXPORT BOOL hb_gtRegister( const HB_GT_INIT * gtInit )
@@ -3185,7 +3182,7 @@ HB_EXPORT void hb_gtStartupInit( void )
}
if( hb_gtLoad( hb_gt_FindDefault(), &s_gtCoreFunc ) )
return;
if( hb_gtLoad( s_defaultGT, &s_gtCoreFunc ) )
if( hb_gtLoad( hb_gt_szNameDefault, &s_gtCoreFunc ) )
return;
if( hb_dynsymFind( "HB_GT_NUL" ) ) /* GTNUL was explicitly requsted */

View File

@@ -236,10 +236,7 @@ static BOOL hb_bTracePrgCalls = FALSE; /* prg tracing is off */
# define HB_TRACE_PRG( _TRMSG_ ) if( hb_bTracePrgCalls ) HB_TRACE( HB_TR_ALWAYS, _TRMSG_ )
#endif
/* TOFIX: s_pszLinkedMain is violating namespace, so it should be
renamed to hb_vm_pszLinkedMain ASAP. [vszakats] */
HB_EXPORT const char * s_pszLinkedMain = NULL; /* name of startup function set by linker */
HB_EXPORT const char * hb_vm_pszLinkedMain = NULL; /* name of startup function set by linker */
/* virtual machine state */
@@ -830,14 +827,14 @@ HB_EXPORT void hb_vmInit( BOOL bStartMainProc )
in other case it's the name of first public function in
first linked moudule which is used if there is no
HB_START_PROCEDURE in code */
if( s_pszLinkedMain && *s_pszLinkedMain == '@' )
pDynSym = hb_dynsymFind( s_pszLinkedMain + 1 );
if( hb_vm_pszLinkedMain && *hb_vm_pszLinkedMain == '@' )
pDynSym = hb_dynsymFind( hb_vm_pszLinkedMain + 1 );
else
{
pDynSym = hb_dynsymFind( HB_START_PROCEDURE );
if( ! ( pDynSym && pDynSym->pSymbol->value.pFunPtr ) && s_pszLinkedMain )
pDynSym = hb_dynsymFind( s_pszLinkedMain );
if( ! ( pDynSym && pDynSym->pSymbol->value.pFunPtr ) && hb_vm_pszLinkedMain )
pDynSym = hb_dynsymFind( hb_vm_pszLinkedMain );
}
if( pDynSym && pDynSym->pSymbol->value.pFunPtr )
@@ -846,9 +843,9 @@ HB_EXPORT void hb_vmInit( BOOL bStartMainProc )
hb_errInternal( HB_EI_VMBADSTARTUP, NULL, HB_START_PROCEDURE, NULL );
}
#else
else if( s_pszLinkedMain )
else if( hb_vm_pszLinkedMain )
{
pDynSym = hb_dynsymFind( s_pszLinkedMain + ( *s_pszLinkedMain == '@' ? 1 : 0 ) );
pDynSym = hb_dynsymFind( hb_vm_pszLinkedMain + ( *hb_vm_pszLinkedMain == '@' ? 1 : 0 ) );
if( pDynSym && pDynSym->pSymbol->value.pFunPtr )
s_pSymStart = pDynSym->pSymbol;
}