On 5/24/18 10:25 PM, Weijun Wang wrote:
https://stackoverflow.com/questions/27509061/macro-to-avoid-duplicate-case-value
Someone has already used them in a switch expression...
Interesting!
I like the very first solution:
#if EAGAIN != EWOULDBLOCK
case EAGAIN:
#endif
case EWOULDBLOCK:
It is descriptive enough and compiles optimally.
Fortunately, we don't have to care about it now, as the fix only adds
checks of errno right after calls to system functions and does not store
the errno value anywhere to analyze it later.
--
With kind regards,
Ivan Gerasimov