You can use a mixin
statement to convert a string into code at compile time e.g.:
mixin("value = 123;");
The following function will generate a string containing a statement which would be the closest equivalent of your C macro:
string soConvenient(alias A)()
{
return std.string.format(
'value = someFunc(%1$s, "%1$s");',
__traits(identifier, A));
}
Which you would then use like this:
mixin(soConvenient!x); // equivalent to 'so_convenient(x) in C