KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Some legacy code I am working on has a macro which returns a comma-separated list intended to be used as function arguments. This is ugly, but the configuration file contains many of these and it would be difficult to change now. #define XY1 0,0 #define XY2 1,7 ... void fun_point(x,y); fun_point(XY1); This works fine as long as it is a function being called. However, when trying to call another macro with the parameters, the whole string is considered as one argument rather than split at the comma into two arguments #define MAC_POINT(x,y) (x+y) MAC_POINT(XY1) #not expanded by preprocessor Is there a workaround for this problem without changing the XY definitions?
Tags (comma-separated)
Save Edits
Cancel