Skip to content

Commit

Permalink
net/types: move socket helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Dec 3, 2022
1 parent be05316 commit b94e470
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 0 additions & 11 deletions include/re_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@
#include <arpa/inet.h>
#endif

/* Socket helpers */
#ifdef WIN32
#define ERRNO_SOCK WSAGetLastError()
#define BAD_SOCK INVALID_SOCKET
typedef size_t re_sock_t;
#else
#define ERRNO_SOCK errno
#define BAD_SOCK -1
typedef int re_sock_t;
#endif

/** Length of IPv4 address string */
#ifndef INET_ADDRSTRLEN
#define INET_ADDRSTRLEN 16
Expand Down
11 changes: 11 additions & 0 deletions include/re_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,14 @@ typedef SSIZE_T ssize_t;
#else
#define re_restrict restrict
#endif

/* Socket helpers */
#ifdef WIN32
#define ERRNO_SOCK WSAGetLastError()
#define BAD_SOCK INVALID_SOCKET
typedef size_t re_sock_t;
#else
#define ERRNO_SOCK errno
#define BAD_SOCK -1
typedef int re_sock_t;
#endif

0 comments on commit b94e470

Please sign in to comment.