Reputation: 3845
If you're going to define these at all, why not define them as
#define SIZEOF_INT sizeof(int)
etc. so they are correct even if someone tries to use them to compile against a different architecture?
Upvotes: 6
Views: 175
Reputation: 3845
I found the answer a minute after asking the question. These macros are sometimes used in the predicates of #if etc. where sizeof calls cannot be evaluated.
For example
#if SIZEOF_LONG_LONG_INT == 8
stuff
#endif
Upvotes: 8