Well observed. I had noticed this detail and adjusted my code to work
so correct with __DYNSN2SYM(). For beginners who are starting these
tips are great.

Many thanks for the explanation.

Vailton Renato

2009/3/15 Przemyslaw Czerpak <dru...@acn.waw.pl>:
> On Sat, 14 Mar 2009, Vailton Renato wrote:
>
> Hi,
>
>> I am migrating some routines for Harbour and noticed the absence of
>> HB_FUNCPTR() that I used before. I came to develop the same function
>> in Harbour and after researching the sources I found __DYNSN2SYM()
>> which has the same purpose.
>> I would like to suggest it was placed within the file hbcompat.ch the
>> following line:
>> #xtranslate HB_FUNCPTR(<x>) => __DYNSN2SYM (<x>)
>> In order to make the conversion automatically.
>
> Viktor already added it but please remember that it's not exactly
> the same.
> In Harbour type of function symbol is "S". In xHarbour it's simple
> pointer item: "P". So the C code will not be compatible.
> To use function symbols in Harbour you do not need any special
> functions. You can simply create them using macro compiler:
>
>   sFunc := &("@str()")
>   ? sFunc:name()
>   ? sFunc:eval( 123.45, 10, 5 )
>
> Probably any xHarbour code which operates on function pointers
> can be ported to Harbour and only the places which checks item
> type should be updated but reverted conversion may not be possible.
> Just simply xHarbour accepts any pointer item as function symbol
> without any verification so it will GPF for wrong pointer item
> types.
>
> best regards,
> Przemek
> _______________________________________________
> Harbour mailing list
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour
>



-- 
Vailton Renato
SQL LIB, MyMake & xDev Developer
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to