dns: исправить сборку под Windows (MinGW)
- dns.c: #define uint32_t → #include <stdint.h> (на UCRT64 stdint.h уже тянется через winsock2.h, макро даёт 'duplicate unsigned') - async_dns.c: p->IpAddress → p->IpAddress.String (IP_ADDR_STRING.IpAddress — IP_ADDRESS_STRING, не char*)
This commit is contained in:
1 parent
1f307046f9
commit
0c3398eb8c
2 files changed
+1
-5
No files matched your search
+1
-1
@@ -92,7 +92,7 @@ int adns_system_servers(struct sockaddr_in* out, int max) {
|
||||
int n = 0;
|
||||
IP_ADDR_STRING* p = &fi->DnsServerList;
|
||||
while (p && n < max) {
|
||||
const char* s = p->IpAddress;
|
||||
const char* s = p->IpAddress.String;
|
||||
while (*s && n < max) {
|
||||
while (*s == ' ' || *s == ',') s++;
|
||||
char tok[64];
|
||||
|
||||
@@ -40,11 +40,7 @@
|
||||
|
||||
#include <limits.h> /* INT_MAX */
|
||||
#include <stddef.h> /* offsetof() */
|
||||
#ifdef _WIN32
|
||||
#define uint32_t unsigned int
|
||||
#else
|
||||
#include <stdint.h> /* uint32_t */
|
||||
#endif
|
||||
#include <stdlib.h> /* malloc(3) realloc(3) free(3) rand(3) random(3) arc4random(3) */
|
||||
#include <stdio.h> /* FILE fopen(3) fclose(3) getc(3) rewind(3) */
|
||||
#include <string.h> /* memcpy(3) strlen(3) memmove(3) memchr(3) memcmp(3) strchr(3) strsep(3) strcspn(3) */
|
||||
|
||||
Reference in new issue
Block a user