Get local IP address on Switch correctly (#1)

This commit is contained in:
Yuuki Hikari 2018-06-11 19:44:19 -04:00 committed by mtheall
parent 10b46172fe
commit 2cb78030be
2 changed files with 5 additions and 2 deletions

View File

@ -2020,7 +2020,7 @@ ftp_init(void)
/* get address to listen on */
serv_addr.sin_family = AF_INET;
#ifdef _3DS
#if defined(_3DS) || defined(SWITCH)
serv_addr.sin_addr.s_addr = gethostid();
serv_addr.sin_port = htons(LISTEN_PORT);
#else

View File

@ -105,8 +105,10 @@ main(int argc,
gfxInitDefault();
gfxSet3D(false);
sdmcWriteSafe(false);
#elif defined(__SWITCH__)
#elif defined(SWITCH)
/* initialize needed Switch services */
//gfxInitResolution(644, 480);
nifmInitialize();
gfxInitDefault();
#endif
@ -176,6 +178,7 @@ log_fail:
/* deinitialize Switch services */
gfxExit();
nifmExit();
#endif
return 0;
}