#define macros

F

franklyn

Hi all,

i'm currently working on some code and i have found macro definitions
that i have never seen before. can anyone help me and tell me what
they mean?

#define IPCV_MORPHOLOGY_PTRS( morphtype, flavor ) \
icv##morphtype##Rect_##flavor##_C1R_t \
icv##morphtype##Rect_##flavor##_C1R_p = 0; \
icv##morphtype##Rect_GetBufSize_##flavor##_C1R_t \
icv##morphtype##Rect_GetBufSize_##flavor##_C1R_p = 0; \
icv##morphtype##Rect_##flavor##_C3R_t \
icv##morphtype##Rect_##flavor##_C3R_p = 0; \
icv##morphtype##Rect_GetBufSize_##flavor##_C3R_t \
icv##morphtype##Rect_GetBufSize_##flavor##_C3R_p = 0; \
icv##morphtype##Rect_##flavor##_C4R_t \
icv##morphtype##Rect_##flavor##_C4R_p = 0; \
icv##morphtype##Rect_GetBufSize_##flavor##_C4R_t \
icv##morphtype##Rect_GetBufSize_##flavor##_C4R_p = 0; \
\
icv##morphtype##_##flavor##_C1R_t \
icv##morphtype##_##flavor##_C1R_p = 0; \
icv##morphtype##_##flavor##_C3R_t \
icv##morphtype##_##flavor##_C3R_p = 0; \
icv##morphtype##_##flavor##_C4R_t \
icv##morphtype##_##flavor##_C4R_p = 0;

I looked in some books and googled for such definitions but didn't
find anything about such "double dashs" (##). Does anyone know a
resource to find a description?

Thanks!
Frank
 
V

Victor Bazarov

i'm currently working on some code and i have found macro definitions
that i have never seen before. can anyone help me and tell me what
they mean?

#define IPCV_MORPHOLOGY_PTRS( morphtype, flavor ) \
icv##morphtype##Rect_##flavor##_C1R_t \
icv##morphtype##Rect_##flavor##_C1R_p = 0; \
icv##morphtype##Rect_GetBufSize_##flavor##_C1R_t \
icv##morphtype##Rect_GetBufSize_##flavor##_C1R_p = 0; \
icv##morphtype##Rect_##flavor##_C3R_t \
icv##morphtype##Rect_##flavor##_C3R_p = 0; \
icv##morphtype##Rect_GetBufSize_##flavor##_C3R_t \
icv##morphtype##Rect_GetBufSize_##flavor##_C3R_p = 0; \
icv##morphtype##Rect_##flavor##_C4R_t \
icv##morphtype##Rect_##flavor##_C4R_p = 0; \
icv##morphtype##Rect_GetBufSize_##flavor##_C4R_t \
icv##morphtype##Rect_GetBufSize_##flavor##_C4R_p = 0; \
\
icv##morphtype##_##flavor##_C1R_t \
icv##morphtype##_##flavor##_C1R_p = 0; \
icv##morphtype##_##flavor##_C3R_t \
icv##morphtype##_##flavor##_C3R_p = 0; \
icv##morphtype##_##flavor##_C4R_t \
icv##morphtype##_##flavor##_C4R_p = 0;

I looked in some books and googled for such definitions but didn't
find anything about such "double dashs" (##). Does anyone know a
resource to find a description?

Look for "token concatenation operator". Essentially it constructs
a new preprocessor token out of its left and right operands. IOW,
A ## B becomes AB.

V
 
F

franklyn

Hey Victor!

thanks for your quick reply! I found some stuff under "token
concatenation operator.

Cheers,
Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,796
Messages
2,569,645
Members
45,368
Latest member
EwanMacvit

Latest Threads

Top