Conditional compilation inside asm and enum declarations

Trass3r mrmocool at gmx.de
Tue Jul 14 18:33:00 PDT 2009


Walter Bright schrieb:
> Don wrote:
>> In this case you may have a long function, with only a single 
>> instruction right in the middle which needs to be changed.
> 
> void foo()
> {
>     asm
>     {
>         mov EAX,EAX;
>     ... lots more instructions ...
>     }
>     version (bar) asm
>     {
>         mov EAX,EAX;
>     }
>     asm
>     {
>     ... even more instructions ...
>         mov EAX,EAX;
>     }
> }

Man, it's so obvious, yet I wouldn't have hit on that ;)



More information about the Digitalmars-d mailing list