LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   error: "." may not appear in macro parameter list? (http://www.linuxquestions.org/questions/programming-9/error-may-not-appear-in-macro-parameter-list-4175437405/)

Shahid nx 11-16-2012 03:51 AM

error: "." may not appear in macro parameter list?
 
I have define macro like this
Code:

#define TSMP_PROV_VAL_PRINT_DFT_IN_PARAMS\
TSMP_PRINT_MSISDN(provDet.subsInfo.msisdn);\
TSMP_PRINT_LANGUAGE(provDet.reqMsg.languageId);\
TSMP_PRINT_INTERFACE(provDet.interface.interfaceId);\
TSMP_PRINT_TRANSID (provDet.transId);\
TSMP_PRINT_NODEID (provDet.reqMsg.nodeid);\
TSMP_PRINT_SRVID (provDet.srvId);\
TSMP_PRINT_PKGID (provDet.srvId);\
TSMP_PRINT_COSID (provDet.subsInfo.cosId);

It is showing
error: "." may not appear in macro parameter list.

Please help me out urgent

dwhitney67 11-16-2012 05:07 AM

What is it that you are trying to do? If I had to guess, it appears that you are attempting to declare a macro that can be used to print values of a complex structure.

Would it not be better to merely declare a function that handles the effort of printing the data you require (in the format you require) and have your main macro defined to be a call to that function?

ntubski 11-16-2012 09:56 AM

You need a space between the first backslash and the macro name, otherwise you are defining a macro called TSMP_PROV_VAL_PRINT_DFT_IN_PARAMSTSMP_PRINT_MSISDN with provDet.subsInfo.msisdn as a parameter.


All times are GMT -5. The time now is 09:57 PM.