Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Commit

Permalink
Add errno setters to platform libs. (#1576)
Browse files Browse the repository at this point in the history
  • Loading branch information
olonho committed May 11, 2018
1 parent 680f15e commit f54f7bf
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
9 changes: 9 additions & 0 deletions platformLibs/src/platform/android/posix.def
Expand Up @@ -23,11 +23,20 @@ static int posix_errno() {
return errno;
}

static void set_posix_errno(int value) {
errno = value;
}


// Wrapper to access h_errno variable.
static int posix_h_errno() {
return h_errno;
}

static void set_posix_h_errno(int value) {
h_errno = value;
}

static int init_sockets() {
return 0;
}
Expand Down
8 changes: 8 additions & 0 deletions platformLibs/src/platform/ios/posix.def
Expand Up @@ -22,11 +22,19 @@ static int posix_errno() {
return errno;
}

static void set_posix_errno(int value) {
errno = value;
}

// Wrapper to access h_errno variable.
static int posix_h_errno() {
return h_errno;
}

static void set_posix_h_errno(int value) {
h_errno = value;
}

static int init_sockets() {
return 0;
}
Expand Down
8 changes: 8 additions & 0 deletions platformLibs/src/platform/linux/posix.def
Expand Up @@ -43,11 +43,19 @@ static int posix_errno() {
return errno;
}

static void set_posix_errno(int value) {
errno = value;
}

// Wrapper to access h_errno variable.
static int posix_h_errno() {
return h_errno;
}

static void set_posix_h_errno(int value) {
h_errno = value;
}

static short posix_htons(short x) {
return htons(x);
}
Expand Down
4 changes: 4 additions & 0 deletions platformLibs/src/platform/mingw/posix.def
Expand Up @@ -13,6 +13,10 @@ static int posix_errno() {
return errno;
}

static void set_posix_errno(int value) {
errno = value;
}

static short posix_htons(short x) {
return htons(x);
}
Expand Down
8 changes: 8 additions & 0 deletions platformLibs/src/platform/osx/posix.def
Expand Up @@ -28,11 +28,19 @@ static int posix_errno() {
return errno;
}

static void set_posix_errno(int value) {
errno = value;
}

// Wrapper to access h_errno variable.
static int posix_h_errno() {
return h_errno;
}

static void set_posix_h_errno(int value) {
h_errno = value;
}

static short posix_htons(short x) {
return htons(x);
}
Expand Down

0 comments on commit f54f7bf

Please sign in to comment.