Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
tyrquake
Commits
4e14644f
Commit
4e14644f
authored
Nov 12, 2019
by
Rinnegatamante
Browse files
Fix vita build.
parent
ce548238
Changes
1
Hide whitespace changes
Inline
Side-by-side
common/net_udp.c
View file @
4e14644f
...
...
@@ -112,6 +112,11 @@ UDP_Init(void)
/* determine my name & address, default to loopback */
myAddr
.
ip
.
l
=
htonl
(
INADDR_LOOPBACK
);
myAddr
.
port
=
htons
(
DEFAULTnet_hostport
);
#ifdef VITA
SceNetCtlInfo
info
;
sceNetCtlInetGetInfo
(
SCE_NETCTL_INFO_GET_IP_ADDRESS
,
&
info
);
sceNetInetPton
(
SCE_NET_AF_INET
,
info
.
ip_address
,
&
myAddr
.
ip
.
l
);
#else
err
=
gethostname
(
buff
,
MAXHOSTNAMELEN
);
if
(
err
)
{
Con_Printf
(
"%s: WARNING: gethostname failed (%s)
\n
"
,
__func__
,
...
...
@@ -128,7 +133,7 @@ UDP_Init(void)
myAddr
.
ip
.
l
=
inaddr
->
s_addr
;
}
}
#endif
i
=
COM_CheckParm
(
"-ip"
);
if
(
i
&&
i
<
com_argc
-
1
)
{
bindAddr
.
ip
.
l
=
inet_addr
(
com_argv
[
i
+
1
]);
...
...
@@ -365,12 +370,13 @@ int
UDP_GetNameFromAddr
(
const
netadr_t
*
addr
,
char
*
name
)
{
struct
hostent
*
hostentry
;
#ifndef VITA
hostentry
=
gethostbyaddr
(
&
addr
->
ip
.
l
,
sizeof
(
addr
->
ip
.
l
),
AF_INET
);
if
(
hostentry
)
{
strncpy
(
name
,
(
char
*
)
hostentry
->
h_name
,
NET_NAMELEN
-
1
);
return
0
;
}
#endif
strcpy
(
name
,
NET_AdrToString
(
addr
));
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment