diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d9ffbd6a76..2cfd8da139 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,35 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ + open :( + +2002-01-03 00:40 UTC-0300 Luiz Rafael Culik + * include/hbfsapi.h + * under Win32 FHANDLE is typedef to long + * source/rtl/filesys.c + * Replaced all X__WIN32__ with __WIN32__ + * hb_fscommit() now used true Win32 Api calls + * No more file limit on Win32 + +2002-01-02 09:40 UTC+0200 Chen Kedem + + * doc/dirstruc.txt + + Add description for newly added directories + +2002-01-02 10:03 UTC+0700 Andi Jahja + * source/compiler/cmdcheck.c + ! harbour did not obey "set clippercmd=/n" -> fixed ( my fault, sorry ) + +2002-01-02 09:06 UTC+0700 Andi Jahja + * source\vm\fm.c + * function hb_xalloc() - Prevention for same symptom as noted on hb_xgrab(): + (see ChangeLog : 2002-01-01 11:15 UTC+0700 Andi Jahja ) + modify memory allocation by adding extra bytes to be allocated + in line with byte alignment. + * include/hbcomp.h + + BOOL hb_comp_bNoStartUp, public variable for generating C-source with for + no_startup option. TRUE = no_startup. FALSE = with_startup + - remove definition of HB_COMPGENC_NO_STARTUP * source/compiler/cmdcheck.c - remove /gc3 switch ! add additional arguments to switch /n : diff --git a/harbour/include/hbcomp.h b/harbour/include/hbcomp.h index 38c2b78ed3..c5e46d53cc 100644 --- a/harbour/include/hbcomp.h +++ b/harbour/include/hbcomp.h @@ -451,6 +451,7 @@ extern BOOL hb_comp_bForceMemvars; extern BOOL hb_comp_bDebugInfo; extern char hb_comp_szPrefix[ 20 ]; extern int hb_comp_iGenCOutput; +extern BOOL hb_comp_bNoStartUp; extern int hb_comp_iExitLevel; extern int hb_comp_iFunctionCnt; extern char hb_comp_cVarType; @@ -503,7 +504,6 @@ extern ULONG hb_comp_Supported; #define HB_COMPGENC_COMPACT 0 #define HB_COMPGENC_NORMAL 1 #define HB_COMPGENC_VERBOSE 2 -#define HB_COMPGENC_NO_STARTUP 3 /* /ES command line setting types */ #define HB_EXITLEVEL_DEFAULT 0 diff --git a/harbour/source/compiler/cmdcheck.c b/harbour/source/compiler/cmdcheck.c index a9bd15ff1b..26f430110f 100644 --- a/harbour/source/compiler/cmdcheck.c +++ b/harbour/source/compiler/cmdcheck.c @@ -106,6 +106,10 @@ static ULONG PackDateTime( void ) void hb_compChkCompilerSwitch( int iArg, char * Args[] ) { + /* Generates implicit startup procedure + */ + hb_comp_bStartProc = TRUE; + /* If iArg is passed check the command line options */ if( iArg ) { @@ -275,6 +279,25 @@ void hb_compChkCompilerSwitch( int iArg, char * Args[] ) j = strlen( Args[i] ); continue; + case 'n' : + case 'N' : + /* Required argument */ + if ( Args[i][j + 1] ) + { + /* Optional argument */ + Switch[2] = Args[i][j + 1]; + Switch[3] = '\0'; + j += 2; + } + else + { + /* No optional argument */ + Switch[2] = '\0'; + j += 1; + } + hb_compChkEnvironVar( (char*) Switch ); + continue; + case 'o' : case 'O' : Args[i] += (j - 1); @@ -534,10 +557,6 @@ void hb_compChkEnvironVar( char * szSwitch ) { case '\0': - case '3': - hb_comp_iGenCOutput = HB_COMPGENC_NO_STARTUP; - break; - case '2': hb_comp_iGenCOutput = HB_COMPGENC_VERBOSE; break; @@ -661,10 +680,29 @@ void hb_compChkEnvironVar( char * szSwitch ) case 'n': case 'N': - if( *( s + 1 ) == '-' ) - hb_comp_bStartProc = TRUE; - else + /* + -n1 no start up procedure and no implicit start up procedure + */ + if( *( s + 1 ) == '1' ) + { hb_comp_bStartProc = FALSE; + hb_comp_bNoStartUp = TRUE; + } + /* + -n or -n0 no implicit start up procedure + */ + else if ( ( *( s + 1 ) == '0' ) || ( *( s + 1 ) == '\0' ) ) + hb_comp_bStartProc = FALSE; + /* + -n- ceates implicit start up procedure + */ + else if( *( s + 1 ) == '-' ) + hb_comp_bStartProc = TRUE; + /* + invalid command + */ + else + hb_compGenError( hb_comp_szErrors, 'F', HB_COMP_ERR_BADOPTION, s, NULL ); break; case 'o': diff --git a/harbour/source/compiler/genc.c b/harbour/source/compiler/genc.c index a6bb173118..04f89d984a 100644 --- a/harbour/source/compiler/genc.c +++ b/harbour/source/compiler/genc.c @@ -156,7 +156,7 @@ void hb_compGenCCode( PHB_FNAME pFileName ) /* generates the C language ou if( ( pSym->cScope != HB_FS_MESSAGE ) && ( pSym->cScope & HB_FS_MESSAGE ) ) /* only for non public symbols */ fprintf( yyc, " | HB_FS_MESSAGE" ); - if ( ( pSym->cScope & HB_FS_FIRST ) && ( hb_comp_iGenCOutput != HB_COMPGENC_NO_STARTUP ) ) + if ( ( pSym->cScope & HB_FS_FIRST ) && ( ! hb_comp_bNoStartUp ) ) fprintf( yyc, " | HB_FS_FIRST" ); /* specify the function address if it is a defined function or an diff --git a/harbour/source/compiler/harbour.c b/harbour/source/compiler/harbour.c index 38d797292d..86f821a825 100644 --- a/harbour/source/compiler/harbour.c +++ b/harbour/source/compiler/harbour.c @@ -113,6 +113,7 @@ BOOL hb_comp_bForceMemvars = FALSE; /* holds if memvars ar BOOL hb_comp_bDebugInfo = FALSE; /* holds if generate debugger required info */ char hb_comp_szPrefix[ 20 ] = { '\0' }; /* holds the prefix added to the generated symbol init function name (in C output currently) */ int hb_comp_iGenCOutput = HB_COMPGENC_VERBOSE; /* C code generation should be verbose (use comments) or not */ +BOOL hb_comp_bNoStartUp = FALSE ; /* C code generation embed HB_FS_FIRST or not */ int hb_comp_iExitLevel = HB_EXITLEVEL_DEFAULT; /* holds if there was any warning during the compilation process */ HB_PATHNAMES * hb_comp_pIncludePath = NULL; int hb_comp_iFunctionCnt; diff --git a/harbour/source/compiler/hbusage.c b/harbour/source/compiler/hbusage.c index d64c694f40..0b34acbfd3 100644 --- a/harbour/source/compiler/hbusage.c +++ b/harbour/source/compiler/hbusage.c @@ -67,7 +67,7 @@ void hb_compPrintUsage( char * szSelf ) "\n %ces[] set exit severity", "\n %cg output type generated is (see below)", "\n %cgc[] output type: C source (.c) (default)", - "\n : 0=compact\n 1=normal\n 2=verbose (default)\n 3=no start up code", + "\n : 0=compact 1=normal 2=verbose (default)", "\n %cgo output type: Platform dependant object module", "\n %cgw output type: Windows/DOS OBJ32 (.obj)", "\n %cgh output type: Harbour Portable Object (.hrb)", @@ -76,7 +76,9 @@ void hb_compPrintUsage( char * szSelf ) "\n %ck compilation mode (type -k? for more data)", "\n %cl suppress line number information", "\n %cm compile module only", - "\n %cn no implicit starting procedure", + "\n %cn[] no implicit starting procedure (default)", + "\n : 0=no implicit starting procedure", + "\n 1=no starting procedure at all", "\n %co object file drive and/or path", "\n %cp generate pre-processed output (.ppo) file", "\n %cq quiet", diff --git a/harbour/source/vm/fm.c b/harbour/source/vm/fm.c index 18481accb3..2a9693a672 100644 --- a/harbour/source/vm/fm.c +++ b/harbour/source/vm/fm.c @@ -185,7 +185,12 @@ void HB_EXPORT * hb_xalloc( ULONG ulSize ) /* allocates fixed memory, re HB_TRACE(HB_TR_DEBUG, ("hb_xalloc(%lu)", ulSize)); - return malloc( ulSize ); + #define ALIGN_SIZE sizeof (double) + #define RESERVE_SIZE (((sizeof (ulSize) + (ALIGN_SIZE - 1)) \ + / ALIGN_SIZE) * ALIGN_SIZE) + return malloc( ulSize + RESERVE_SIZE ); + +/* return malloc( ulSize ); */ #endif }