Tweak: Add prefix to non-static function names (#12764)
to avoid conflicts with other functions. This was pointed out in https://github.com/ruby/ruby/pull/11653#discussion_r1837356617 , but it was not fixed at that time.
This commit is contained in:
parent
cfca348436
commit
e9ba334fd1
Notes:
git
2025-02-18 12:09:25 +00:00
Merged-By: shioimm <shioi.mm@gmail.com>
@ -1217,8 +1217,8 @@ rsock_init_inetsock(VALUE self, VALUE remote_host, VALUE remote_serv, VALUE loca
|
|||||||
char *hostp, *portp;
|
char *hostp, *portp;
|
||||||
char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
|
char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
|
||||||
int additional_flags = 0;
|
int additional_flags = 0;
|
||||||
hostp = host_str(remote_host, hbuf, sizeof(hbuf), &additional_flags);
|
hostp = raddrinfo_host_str(remote_host, hbuf, sizeof(hbuf), &additional_flags);
|
||||||
portp = port_str(remote_serv, pbuf, sizeof(pbuf), &additional_flags);
|
portp = raddrinfo_port_str(remote_serv, pbuf, sizeof(pbuf), &additional_flags);
|
||||||
|
|
||||||
if (!is_specified_ip_address(hostp)) {
|
if (!is_specified_ip_address(hostp)) {
|
||||||
int target_families[2] = { 0, 0 };
|
int target_families[2] = { 0, 0 };
|
||||||
|
@ -823,7 +823,7 @@ str_is_number(const char *p)
|
|||||||
rb_strlen_lit(name) == (len) && memcmp(ptr, name, len) == 0)
|
rb_strlen_lit(name) == (len) && memcmp(ptr, name, len) == 0)
|
||||||
|
|
||||||
char*
|
char*
|
||||||
host_str(VALUE host, char *hbuf, size_t hbuflen, int *flags_ptr)
|
raddrinfo_host_str(VALUE host, char *hbuf, size_t hbuflen, int *flags_ptr)
|
||||||
{
|
{
|
||||||
if (NIL_P(host)) {
|
if (NIL_P(host)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -862,7 +862,7 @@ host_str(VALUE host, char *hbuf, size_t hbuflen, int *flags_ptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char*
|
char*
|
||||||
port_str(VALUE port, char *pbuf, size_t pbuflen, int *flags_ptr)
|
raddrinfo_port_str(VALUE port, char *pbuf, size_t pbuflen, int *flags_ptr)
|
||||||
{
|
{
|
||||||
if (NIL_P(port)) {
|
if (NIL_P(port)) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -914,7 +914,7 @@ rb_scheduler_getaddrinfo(VALUE scheduler, VALUE host, const char *service,
|
|||||||
|
|
||||||
for(i=0; i<len; i++) {
|
for(i=0; i<len; i++) {
|
||||||
ip_address = rb_ary_entry(ip_addresses_array, i);
|
ip_address = rb_ary_entry(ip_addresses_array, i);
|
||||||
hostp = host_str(ip_address, _hbuf, sizeof(_hbuf), &_additional_flags);
|
hostp = raddrinfo_host_str(ip_address, _hbuf, sizeof(_hbuf), &_additional_flags);
|
||||||
error = numeric_getaddrinfo(hostp, service, hints, &ai);
|
error = numeric_getaddrinfo(hostp, service, hints, &ai);
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
if (!res_allocated) {
|
if (!res_allocated) {
|
||||||
@ -950,8 +950,8 @@ rsock_getaddrinfo(VALUE host, VALUE port, struct addrinfo *hints, int socktype_h
|
|||||||
char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
|
char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
|
||||||
int additional_flags = 0;
|
int additional_flags = 0;
|
||||||
|
|
||||||
hostp = host_str(host, hbuf, sizeof(hbuf), &additional_flags);
|
hostp = raddrinfo_host_str(host, hbuf, sizeof(hbuf), &additional_flags);
|
||||||
portp = port_str(port, pbuf, sizeof(pbuf), &additional_flags);
|
portp = raddrinfo_port_str(port, pbuf, sizeof(pbuf), &additional_flags);
|
||||||
|
|
||||||
if (socktype_hack && hints->ai_socktype == 0 && str_is_number(portp)) {
|
if (socktype_hack && hints->ai_socktype == 0 && str_is_number(portp)) {
|
||||||
hints->ai_socktype = SOCK_DGRAM;
|
hints->ai_socktype = SOCK_DGRAM;
|
||||||
@ -1137,7 +1137,7 @@ make_hostent_internal(VALUE v)
|
|||||||
hostp = addr->ai_canonname;
|
hostp = addr->ai_canonname;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
hostp = host_str(host, hbuf, sizeof(hbuf), NULL);
|
hostp = raddrinfo_host_str(host, hbuf, sizeof(hbuf), NULL);
|
||||||
}
|
}
|
||||||
rb_ary_push(ary, rb_str_new2(hostp));
|
rb_ary_push(ary, rb_str_new2(hostp));
|
||||||
|
|
||||||
|
@ -414,8 +414,8 @@ ssize_t rsock_recvmsg(int socket, struct msghdr *message, int flags);
|
|||||||
void rsock_discard_cmsg_resource(struct msghdr *mh, int msg_peek_p);
|
void rsock_discard_cmsg_resource(struct msghdr *mh, int msg_peek_p);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *host_str(VALUE host, char *hbuf, size_t hbuflen, int *flags_ptr);
|
char *raddrinfo_host_str(VALUE host, char *hbuf, size_t hbuflen, int *flags_ptr);
|
||||||
char *port_str(VALUE port, char *pbuf, size_t pbuflen, int *flags_ptr);
|
char *raddrinfo_port_str(VALUE port, char *pbuf, size_t pbuflen, int *flags_ptr);
|
||||||
|
|
||||||
#ifndef FAST_FALLBACK_INIT_INETSOCK_IMPL
|
#ifndef FAST_FALLBACK_INIT_INETSOCK_IMPL
|
||||||
# if !defined(HAVE_PTHREAD_CREATE) || !defined(HAVE_PTHREAD_DETACH) || defined(__MINGW32__) || defined(__MINGW64__)
|
# if !defined(HAVE_PTHREAD_CREATE) || !defined(HAVE_PTHREAD_DETACH) || defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user