Conditional compilation inside asm and enum declarations

Tomas Lindquist Olsen tomas.l.olsen at gmail.com
Wed Jul 15 03:16:58 PDT 2009


On Wed, Jul 15, 2009 at 2:18 AM, Walter
Bright<newshound1 at digitalmars.com> wrote:
> 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;
>    }
> }
>


Since when does D guarantee that no code is inserted before/after asm blocks?



More information about the Digitalmars-d mailing list