I am using a switch expression in C in order to evaluate the errno variable. According to the man page for `send()`:

**EAGAIN or EWOULDBLOCK**

> 
> 
> ```
> The socket is marked nonblocking and the requested operation would block.
> POSIX.1-2001 allows either error to be returned for this case,and does not
> require these constants to have the same value, so a portable application
> should check for both possibilities.
> 
> ```
> 
> 

Since my application must be portable, I have to do:

```
switch (errno):
  case EWOULDBLOCK:
  case EAGAIN:
    //do whatever
    break;
  case EINTR:
    //...

```

The problem is that for some platforms, EWOULDBLOCK and EAGAIN do have the same value, so when compiling I get:

> 
> 
> ```
>  connection.cxx:190:5: error: duplicate case value
>  case EWOULDBLOCK:
>  ^
>  connection.cxx:189:5: error: previously used here
>  case EAGAIN:
>  ^
> 
> ```
> 
> 

So I thought I could use a macro macro that depending on whether EWOULDBLOCK and EAGAIN have the same value or not for the platform adds that line to the code or omits it.

Any idea on how to write that macro?