convert define

cardmaker

Member
Joined
Jan 12, 2019
Messages
21
Programming Experience
Beginner
hello, anyone can help finding the equivalent in c# of this?

C:
 define PERM_OP(a,b,t,n,m) ((t)=((((a)>>(n))^(b))&(m)),\
        (b)^=(t),\
        (a)^=((t)<<(n)))

many thanks
 
You'll just have to make it into a method that takes the appropriate steps. Probably decorate the method for suggested inlining. Current versions of C# doesn't have macros. An alternative is to use T4 to generate the code, but you still won't get quite the same effect of having a macro that you can invoke anytime. It will be useful if you are building static table, though.
 
Back
Top Bottom