The TYPESIZE macro is used within another macro which defines constants. #define M(a,b,size) \ ((a) << SHIFT_A) | \ ((b) << SHIFT_B) | \ ((size) << SHIFT_SIZE)) #define MM(a,b,type) M((a),(b),(TYPESIZE(type)))Example: #define C1 MM(1, 2, struct A) #define C2 MM(3, 4, struct B) How can I translate that to D?
You could just get rid of that extra macro and directly pass A.sizeof. Otherwise you need to use templates. Can't say more cause I can't imagine what the heck this code is used for.