Weird macro definition, help please

Hi,
In the autolight.cginc file, we have a line

#define SHADOW_COORDS(idx1) unityShadowCoord4  _ShadowCoord : TEXCOORD##idx1;

Now in the UnityStandardCore.cginc file, we have an usage of this macro like this:

SHADOW_COORDS(6)

Logically speaking, if I unroll this macro, the code becomes like this:

unityShadowCoord4  _ShadowCoord : TEXCOORD##6;

“unityShadowCoord4” is another macro for datatype. Depending upon runtime platform and other settings, this basically means either float4 or fixed4 or half4 etc etc. So this code in the UnityStandardCore.cginc:

SHADOW_COORDS(6)

Bascially means like this, (for an specific runtime platform and specific lighting settings):

half4  _ShadowCoord : TEXCOORD##6;

Now my question is, what the this “##” thing in the macro definition? I am not getting what it is mean! :frowning:

Hmm looks like if I omit “##” thing from macro definition then, to compiler it becomes like:

#define SHADOW_COORDS(idx1) unityShadowCoord4  _ShadowCoord : TEXCOORDidx1;

So, to expand macro where compiler should substitute number 6? May be it will be difficult to recognize “idx1” from a string soup “TEXCOORDidx1”. Is this why, we use “##”?