Skip to content

Commit

Permalink
Add inline to C functions
Browse files Browse the repository at this point in the history
  • Loading branch information
taras committed Oct 6, 2024
1 parent 280ea45 commit 25ca108
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions picows/picows_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#include <winsock2.h>
#define PICOWS_SOCKET_ERROR SOCKET_ERROR

static int picows_convert_wsa_error_to_errno(int ec)
static inline int picows_convert_wsa_error_to_errno(int ec)
{
switch(ec)
{
Expand Down Expand Up @@ -93,12 +93,12 @@
}
}

static int picows_get_errno(void)
static inline int picows_get_errno(void)
{
return picows_convert_wsa_error_to_errno(WSAGetLastError());
}

static double picows_get_monotonic_time(void)
static inline double picows_get_monotonic_time(void)
{
LARGE_INTEGER frequency, counter;
QueryPerformanceFrequency(&frequency);
Expand All @@ -114,9 +114,9 @@
#define PICOWS_EAGAIN EAGAIN
#define PICOWS_EWOULDBLOCK EWOULDBLOCK

static int picows_get_errno(void) { return errno; }
static inline int picows_get_errno(void) { return errno; }

static double picows_get_monotonic_time(void)
static inline double picows_get_monotonic_time(void)
{
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
Expand Down

0 comments on commit 25ca108

Please sign in to comment.