better error messages for various macro definition errors
Merge pull request #3216 from xeno-by/topic/macro-error-messages

better error messages for various macro definition errors