[Harbour] ChangeLog 2007-08-22 19:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

Przemyslaw Czerpak druzus at priv.onet.pl
Thu Aug 23 15:41:37 EDT 2007


On Thu, 23 Aug 2007, Teo Fonrouge wrote:
> 1. Why it is neccesary to have HB_ARGV(0) within the 
> HB_COMPILEBUF/HB_COMPILEFROMBUF functions ?
>   ( the starting executable is doing the compilation in a separate process ? )

It's only for some existing or future compiler messages which may use
process name. You can pass any value as first argument.
No additional processes are created.

> 2. I need to set inside the source code the -n compilation switch (no implicit 
> starting procedure). How can I set a determined compile switch ?
>   ( Is there a #pragma alike syntax available ? )

It's not possible. You have to pass "-n" to HB_COMPILE*() switch. In hbrun
"-n" is enabled by default.
It's possible to change some compiler switches using #pragma, f.e.:

    #pragma -es2
or:
    #pragma ExitSeverity=2

    #pragma -w2
or:
    #pragma WarningLevel=2

etc. but -n cannot be changed in such way - just simply it has to be
defined at beginning of compilation. If you need such functionality
then you can easy add support for it yourself, f.e. use this function
to take default switches:

   func getSwitches( cFile )
      local cLine, cHead := "//COMPILE:"
      cLine := alltrim( memoline( memoread( cFile ),, 1 ) )
      if UPPER( cLine ) = cHead
         return hb_atokens( substr( cLine, len( cHead ) + 1 ) )
      endif
   return {}

and then if you will want to set some compiler switches simply start
your surce code with sth like:

   //COMPILE: -n -w -es2

and use getSwitches( cFile ) as one of HB_COMPILE*() parameters.


> 3. It is possible to 'override' a currently compiled/linked function (inside 
> the current executable binary) with a new one (the same name) created from 
> the HB_COMPILEBUF/HB_COMPILEFROMBUF and loaded in the symbol table with 
> __hbLoad() ?

Not yet. Now functions are not overloaded. In the future I'll add support
for it to HB_LIBLOAD() and __hrbLoad(). These functions will accept numeric
parameter with some default actions, f.e.:
   HB_RTLD_LAZY         // allow to load libraries with unsuficient
                        // dependences
   HB_RTLD_NOCONFLICT   // refuse to load library when name conflict appears
   HB_RTLD_OVERLOADFUNC // overload existing functions
   HB_RTLD_LOCALFUNC    // overload functions only locally (in loaded module)
   HB_RTLD_NOINIT       // do not execute INIT functions
   HB_RTLD_NOEXIT       // do not execute EXIT functions
   HB_RTLD_REINITSTATIC // force static variable reinitialization when
                        // library was unloaded and then loaded again
etc.

best regards,
Przemek


More information about the Harbour mailing list