To answer your question about ternary , this is either an example of an error (forgetting to finish entering the code), or someone is trying to create their own (strange and contradictory) syntax. A macro can be used as follows:
FOO(someVar, doThisIfSomeVarIsBad) doThisIfSomeVarIsGood(stuff);
Where someVar is a pointer (pointer to struct or pointer to structure converted to another type of pointer), doThisIfSomeVarIsBad is a pointer to the error display function, and doThisIfSomeVarIsGood(stuff) is any statement.
This is pretty general (as your example), but I hope you get this idea.
This is a funny, but still weird way of handling errors. But well, this is not so bad, I have seen worse abuse of the preprocessor ...
To answer your other questions :
((SOMEPOINTER)(s))->VALID means that you send s to the type of the pointer to the structure and get access to its member ( -> means access to the struct element through a pointer to the structure).
\ , appearing before a new line, "escapes" a new line. This is necessary because #define -s must be (formally) single-line, so if you split the macro between lines, you must make the compiler think that it is still one.
And yes, functional macros are different from built-in functions; they do not return anything. These are simple tools for replacing text; they simply replace some code with some other code.
source share