i'm having trouble trying to define this function-like macro, which takes 4 vector magnitudes representing the major and minor axis of the top faces of a general cylinder and determines the type of general cylinder. EQUAL is an already defined macro to see if two floating point values are "equal" to one another.
3080 #define GET_TGC_TYPE(_type, _a, _b, _c, _d) { \
3081 if (EQUAL((_a), (_b)) && EQUAL((_c), (_d))) { \
3082 /* circular base and top */
3083 if (EQUAL((_a), (_c))) { \
3084 /* right circular cylinder */
3085 (_type) = RCC; \
3086 } else { \
3087 /* truncated right cone */
3088 (_type) = TRC; \
3089 } \
3090 } else { \
3091 /* elliptical base or top */
3092 if (EQUAL((_a), (_c)) && EQUAL((_b), (_d))) { \
3093 /* right elliptical cylinder */
3094 (_type) = REC; \
3095 } else { \
3096 /* truncated elliptical cone */
3097 (_type) = TEC; \
3098 } \
3099 }
3100 }
the errors i'm getting are
3083:9: error: expected identifier or ‘(’ before ‘if’
3086:11: error: expected identifier or ‘(’ before ‘else’
3090:5: error: expected identifier or ‘(’ before ‘}’ token
3090:7: error: expected identifier or ‘(’ before ‘else’
3100:1: error: expected identifier or ‘(’ before ‘}’ token
i dont have very much experience with C macros so its entirely possible i'm missing something obvious.