Conditional compilation inside asm and enum declarations

Walter Bright newshound1 at digitalmars.com
Tue Jul 14 17:18:13 PDT 2009


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;
     }
}



More information about the Digitalmars-d mailing list