Skip to content
Snippets Groups Projects
Commit 8c95808d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Borland didn't include inet_ntop() or inet_pton()

Fixes CI and nightly build.
parent 0eb0f451
Branches
Tags
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3035 failed
...@@ -719,7 +719,13 @@ char* iniSetIpAddress(str_list_t* list, const char* section, const char* key, ui ...@@ -719,7 +719,13 @@ char* iniSetIpAddress(str_list_t* list, const char* section, const char* key, ui
char buf[128]; char buf[128];
struct in_addr in_addr; struct in_addr in_addr;
in_addr.s_addr=htonl(value); in_addr.s_addr=htonl(value);
return iniSetString(list, section, key, inet_ntop(AF_INET, &in_addr, buf, sizeof(buf)), style); return iniSetString(list, section, key,
#ifdef __BORLANDC__
inet_ntoa(in_addr), // deprecated function call
#else
inet_ntop(AF_INET, &in_addr, buf, sizeof(buf)),
#endif
style);
} }
char* iniSetIp6Address(str_list_t* list, const char* section, const char* key, struct in6_addr value char* iniSetIp6Address(str_list_t* list, const char* section, const char* key, struct in6_addr value
...@@ -1633,11 +1639,16 @@ int iniGetSocketOptions(str_list_t list, const char* section, SOCKET sock ...@@ -1633,11 +1639,16 @@ int iniGetSocketOptions(str_list_t list, const char* section, SOCKET sock
static uint32_t parseIpAddress(const char* value) static uint32_t parseIpAddress(const char* value)
{ {
uint32_t result = 0;
if(strchr(value,'.')==NULL) if(strchr(value,'.')==NULL)
return(strtol(value,NULL,0)); return(strtol(value,NULL,0));
uint32_t result = 0; #ifdef __BORLANDC__
result = inet_addr(value); // deprecated function call
#else
inet_pton(AF_INET, value, &result); inet_pton(AF_INET, value, &result);
#endif
return ntohl(result); return ntohl(result);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment