My macro doesn’t fit nicely on the screen without scrolling, so I want to break it up so it reads nicely. It works fine if it looks like this:
#define longMacro(ptr, idx0, idx1, idx2, idx3, idx4, dim1, dim2, dim3, dim4) (*((ptr) + (idx0) * (dim1) * (dim2) * (dim3) * (dim4) + (idx1) * (dim2) * (dim3) * (dim4) + (idx2) * (dim3) * (dim4) + (idx3) * (dim4) + (idx4)))
but when I try to break it up like this:
#define longMacro(ptr, idx0, idx1, idx2, idx3, idx4, dim1, dim2, dim3, dim4)
(*((ptr) + (idx0) * (dim1) * (dim2) * (dim3) * (dim4)
+ (idx1) * (dim2) * (dim3) * (dim4) + (idx2) * (dim3) * (dim4)
+ (idx3) * (dim4) + (idx4)))
I get these errors
error: expected `)’ before ‘+’ token
error: expected `)’ before ‘+’ token
error: expected `)’ before ‘+’ token
error: expected `)’ before ‘+’ token
i think you’re missing a “\” before the end of each line