Click here to Skip to main content
15,885,720 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
#define ABC(restriction, setting, Feature) \
    if ((restriction)[XY_FTR_##Feature##].AcStatusRestrictions == OFF) \
    {                                                                                        \
        int Index;                                                                         \
        for (Index = 0; Index < N; ++Index)                          \
        {                                                                                    \
            (setting)->EnabledFeatures[POLICY_AC][Index].##Feature## = 0;    \
        }                                                                                    \
    }

and using Macro like this
ABC(pD->PTable, setting,PSR);


Which gives the error:
error(clang): pasting formed '.PSR', an invalid preprocessing token [-Winvalid-token-paste]


What I have tried:

#define ABC(restriction, setting, Feature) \
    if ((restriction)[XY_FTR_##Feature].AcStatusRestrictions == OFF) \
    {                                                                                        \
        int Index;                                                                         \
        for (Index = 0; Index < N; ++Index)                          \
        {                                                                                    \
            (setting)->EnabledFeatures[POLICY_AC][Index].##Feature = 0;    \
        }                                                                                    \
    }


I have tried like this but it's not working.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900