pragma(mangle, "name") suggestion !

Mathias Lang pro.mathias.lang at gmail.com
Thu Mar 19 05:34:10 UTC 2020


On Thursday, 19 March 2020 at 05:05:37 UTC, Calvin P wrote:
> On Thursday, 19 March 2020 at 04:59:14 UTC, Calvin P wrote:
>> ===========
>>  pragma(mangle,  name ~ "_myAction")
>> void myAction(string name, ubyte[][] fields)(){
>>
>>
>> }
>> ===========
>>
>
> If allow pragma(mangle)  defined inside function will fix this 
> problem.   just like pragma(inline);
>
> ========
> void myAction(string name, ubyte[][] fields)(){
>         pragma(mangle,  name ~ "_myAction");
>         pragma(inline, true);
>  }
> ======

Or just use:
template myAction(string name)
{
     pragma(mangle, name ~ "_myAction")
     void myAction(ubyte[][] fields) ()
     {
     ]
}


Although if you need to use such trick, I would recommend you to 
reorganize your code.
Do you have a link to the code ?


More information about the Digitalmars-d mailing list