Skip to content

Commit

Permalink
sa,types: add ERRNO_SOCKET handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Mar 26, 2022
1 parent aff1afc commit 12f0d91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions include/re_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,10 @@ typedef bool _Bool;
*/
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)


#ifdef WIN32
#define ERRNO_SOCKET WSAGetLastError()
#else
#define ERRNO_SOCKET errno
#endif
2 changes: 1 addition & 1 deletion src/sa/sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ int sa_ntop(const struct sa *sa, char *buf, int size)
}

if (!ret)
return errno;
return ERRNO_SOCKET;

return 0;
}
Expand Down

0 comments on commit 12f0d91

Please sign in to comment.