mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	Merge pull request #899 from zawata/Winsock-Deprecation
SOC:U : Fix WinSock function deprecation
This commit is contained in:
		
						commit
						4ccc171db4
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		|  | @ -481,11 +481,17 @@ static void GetHostId(Service::Interface* self) { | ||||||
| 
 | 
 | ||||||
|     char name[128]; |     char name[128]; | ||||||
|     gethostname(name, sizeof(name)); |     gethostname(name, sizeof(name)); | ||||||
|     hostent* host = gethostbyname(name); |     addrinfo hints = {}; | ||||||
|     in_addr* addr = reinterpret_cast<in_addr*>(host->h_addr); |     addrinfo* res; | ||||||
|  | 
 | ||||||
|  |     hints.ai_family = AF_INET; | ||||||
|  |     getaddrinfo(name, NULL, &hints, &res); | ||||||
|  |     sockaddr_in* sock_addr = reinterpret_cast<sockaddr_in*>(res->ai_addr); | ||||||
|  |     in_addr* addr = &sock_addr->sin_addr; | ||||||
| 
 | 
 | ||||||
|     cmd_buffer[2] = addr->s_addr; |     cmd_buffer[2] = addr->s_addr; | ||||||
|     cmd_buffer[1] = 0; |     cmd_buffer[1] = 0; | ||||||
|  |     freeaddrinfo(res); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void Close(Service::Interface* self) { | static void Close(Service::Interface* self) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue