Thursday, April 18, 2019

How to add commend in "macro function" or #define ?

int small_func(int a)
{
    // input plus two
    return (a + 2);
}

#define SMALL_FUNC(a) ({ \
    int result;
    do { \
        /* input plus two */ \
        result = a + 2; \
    } while(0); \
    result; \
})

How to Add Comments to Macros

No comments: