Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
4798e18e
Commit
4798e18e
authored
1 year ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Create get_socket_errno() to replace ERROR_VALUE macro eventually
parent
80379e91
No related branches found
No related tags found
1 merge request
!463
MRC mods by Codefenix (2024-10-20)
Pipeline
#4525
passed
1 year ago
Stage: build
Changes
2
Pipelines
3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/xpdev/sockwrap.c
+43
-33
43 additions, 33 deletions
src/xpdev/sockwrap.c
src/xpdev/sockwrap.h
+2
-1
2 additions, 1 deletion
src/xpdev/sockwrap.h
with
45 additions
and
34 deletions
src/xpdev/sockwrap.c
+
43
−
33
View file @
4798e18e
...
@@ -731,6 +731,16 @@ DLLEXPORT void set_socket_errno(int err)
...
@@ -731,6 +731,16 @@ DLLEXPORT void set_socket_errno(int err)
#endif
#endif
}
}
DLLEXPORT
int
get_socket_errrno
(
void
)
{
#if defined(_WINSOCKAPI_)
int
wsa_error
=
WSAGetLastError
();
return
wsa_error
>=
WSABASEERR
?
wsa_error
-
WSABASEERR
:
wsa_error
;
#else
return
errno
;
#endif
}
DLLEXPORT
int
xp_inet_pton
(
int
af
,
const
char
*
src
,
void
*
dst
)
DLLEXPORT
int
xp_inet_pton
(
int
af
,
const
char
*
src
,
void
*
dst
)
{
{
struct
addrinfo
hints
=
{
0
};
struct
addrinfo
hints
=
{
0
};
...
...
This diff is collapsed.
Click to expand it.
src/xpdev/sockwrap.h
+
2
−
1
View file @
4798e18e
...
@@ -239,6 +239,7 @@ DLLEXPORT void inet_setaddrport(union xp_sockaddr *addr, uint16_t port);
...
@@ -239,6 +239,7 @@ DLLEXPORT void inet_setaddrport(union xp_sockaddr *addr, uint16_t port);
DLLEXPORT
BOOL
inet_addrmatch
(
union
xp_sockaddr
*
addr1
,
union
xp_sockaddr
*
addr2
);
DLLEXPORT
BOOL
inet_addrmatch
(
union
xp_sockaddr
*
addr1
,
union
xp_sockaddr
*
addr2
);
DLLEXPORT
char
*
socket_strerror
(
int
,
char
*
,
size_t
);
DLLEXPORT
char
*
socket_strerror
(
int
,
char
*
,
size_t
);
DLLEXPORT
void
set_socket_errno
(
int
);
DLLEXPORT
void
set_socket_errno
(
int
);
DLLEXPORT
int
get_socket_errno
(
void
);
DLLEXPORT
int
xp_inet_pton
(
int
af
,
const
char
*
src
,
void
*
dst
);
DLLEXPORT
int
xp_inet_pton
(
int
af
,
const
char
*
src
,
void
*
dst
);
#if defined(_WIN32) // mingw and WinXP's WS2_32.DLL don't have inet_pton():
#if defined(_WIN32) // mingw and WinXP's WS2_32.DLL don't have inet_pton():
#define inet_pton xp_inet_pton
#define inet_pton xp_inet_pton
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment