[fpc-pascal]Nul sub-routine

Florian Klaempfl Florian.Klaempfl at gmx.de
Wed Sep 20 23:37:36 CEST 2000


IoDream wrote:
> 
>           Hello to all,
> 
>    I would like to know if we can define a sub-routine to be nul, so that
> when compiling this routine hold no byte at all. This is what a macro do,
> but macros aren't implemented yet in FPC.
>    This could be used, for example, in a C-like "assert" function that when
> NDEBUG is defined the function is inserted, and when it isn't the function
> waste no space. I include a DJGPP version of the function prototype.
>    In other words; this is equivalent to the lines below, but is easier to
> write, and looks much better in your source:
> {$IFDEF NDEBUG}
>   Assert(blabla);
> {$ENDIF}
> 

FPC supports Assert. If you compile without -Sa it is ignored.




More information about the fpc-pascal mailing list