No; the sizeof() operator does not work in conditional C preprocessor directives, such as #if and #elif .
The reason is that the C preprocessor does not know anything about type sizes.
You can use sizeof() in the body of the macro #define 'd, of course, because the compiler processes the analysis of the replacement text, but the preprocessor does not. For example, a classic macro gives the number of elements in an array; these are different names, but there are:
#define DIM(x) (sizeof(x)/sizeof(*(x)))
This can be used with:
static const char *list[] = { "...", ... }; size_t size_list = DIM(list);
That you can not do:
#if sizeof(long) > sizeof(int)
(The problem is that the condition evaluates to #if 0(0) > 0(0) under all plausible circumstances, and the parentheses make the expression invalid even with liberal preprocessor arithmetic rules.)
source share