mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
Fix header compatibility with c++ dialects.
This allows the option of at least -std=gnu++14 for new translation units. Changes are trivial.
This commit is contained in:
parent
de800bd3d7
commit
acd516444a
9 changed files with 16 additions and 17 deletions
|
@ -28,7 +28,6 @@
|
||||||
#include "defaults.h"
|
#include "defaults.h"
|
||||||
|
|
||||||
struct Client;
|
struct Client;
|
||||||
struct rb_dlink_list;
|
|
||||||
|
|
||||||
struct SetOptions
|
struct SetOptions
|
||||||
{
|
{
|
||||||
|
|
|
@ -203,7 +203,7 @@ struct server_conf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *class_name;
|
char *class_name;
|
||||||
struct Class *class;
|
struct Class *_class;
|
||||||
rb_dlink_node node;
|
rb_dlink_node node;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ get_client_ping(struct Client *target_p)
|
||||||
if(IsServer(target_p))
|
if(IsServer(target_p))
|
||||||
{
|
{
|
||||||
struct server_conf *server_p = target_p->localClient->att_sconf;
|
struct server_conf *server_p = target_p->localClient->att_sconf;
|
||||||
ping = PingFreq(server_p->class);
|
ping = PingFreq(server_p->_class);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -325,7 +325,7 @@ get_sendq(struct Client *client_p)
|
||||||
{
|
{
|
||||||
struct server_conf *server_p;
|
struct server_conf *server_p;
|
||||||
server_p = client_p->localClient->att_sconf;
|
server_p = client_p->localClient->att_sconf;
|
||||||
return MaxSendq(server_p->class);
|
return MaxSendq(server_p->_class);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -2005,7 +2005,7 @@ close_connection(struct Client *client_p)
|
||||||
server_p->hold = time(NULL);
|
server_p->hold = time(NULL);
|
||||||
server_p->hold +=
|
server_p->hold +=
|
||||||
(server_p->hold - client_p->localClient->lasttime >
|
(server_p->hold - client_p->localClient->lasttime >
|
||||||
HANGONGOODLINK) ? HANGONRETRYDELAY : ConFreq(server_p->class);
|
HANGONGOODLINK) ? HANGONRETRYDELAY : ConFreq(server_p->_class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -442,13 +442,13 @@ add_server_conf(struct server_conf *server_p)
|
||||||
if(EmptyString(server_p->class_name))
|
if(EmptyString(server_p->class_name))
|
||||||
{
|
{
|
||||||
server_p->class_name = rb_strdup("default");
|
server_p->class_name = rb_strdup("default");
|
||||||
server_p->class = default_class;
|
server_p->_class = default_class;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
server_p->class = find_class(server_p->class_name);
|
server_p->_class = find_class(server_p->class_name);
|
||||||
|
|
||||||
if(server_p->class == default_class)
|
if(server_p->_class == default_class)
|
||||||
{
|
{
|
||||||
conf_report_error("Warning connect::class invalid for %s",
|
conf_report_error("Warning connect::class invalid for %s",
|
||||||
server_p->name);
|
server_p->name);
|
||||||
|
@ -511,7 +511,7 @@ attach_server_conf(struct Client *client_p, struct server_conf *server_p)
|
||||||
detach_server_conf(client_p);
|
detach_server_conf(client_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrUsers(server_p->class)++;
|
CurrUsers(server_p->_class)++;
|
||||||
|
|
||||||
client_p->localClient->att_sconf = server_p;
|
client_p->localClient->att_sconf = server_p;
|
||||||
server_p->servers++;
|
server_p->servers++;
|
||||||
|
@ -527,13 +527,13 @@ detach_server_conf(struct Client *client_p)
|
||||||
|
|
||||||
client_p->localClient->att_sconf = NULL;
|
client_p->localClient->att_sconf = NULL;
|
||||||
server_p->servers--;
|
server_p->servers--;
|
||||||
CurrUsers(server_p->class)--;
|
CurrUsers(server_p->_class)--;
|
||||||
|
|
||||||
if(ServerConfIllegal(server_p) && !server_p->servers)
|
if(ServerConfIllegal(server_p) && !server_p->servers)
|
||||||
{
|
{
|
||||||
/* the class this one is using may need destroying too */
|
/* the class this one is using may need destroying too */
|
||||||
if(MaxUsers(server_p->class) < 0 && CurrUsers(server_p->class) <= 0)
|
if(MaxUsers(server_p->_class) < 0 && CurrUsers(server_p->_class) <= 0)
|
||||||
free_class(server_p->class);
|
free_class(server_p->_class);
|
||||||
|
|
||||||
rb_dlinkDelete(&server_p->node, &server_conf_list);
|
rb_dlinkDelete(&server_p->node, &server_conf_list);
|
||||||
free_server_conf(server_p);
|
free_server_conf(server_p);
|
||||||
|
|
|
@ -272,7 +272,7 @@ try_connections(void *unused)
|
||||||
if(ServerConfSSL(tmp_p) && (!ircd_ssl_ok || !get_ssld_count()))
|
if(ServerConfSSL(tmp_p) && (!ircd_ssl_ok || !get_ssld_count()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
cltmp = tmp_p->class;
|
cltmp = tmp_p->_class;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Skip this entry if the use of it is still on hold until
|
* Skip this entry if the use of it is still on hold until
|
||||||
|
|
|
@ -191,6 +191,6 @@ rb_fde_t *rb_recv_fd(rb_fde_t *);
|
||||||
|
|
||||||
const char *rb_ssl_get_cipher(rb_fde_t *F);
|
const char *rb_ssl_get_cipher(rb_fde_t *F);
|
||||||
|
|
||||||
int rb_ipv4_from_ipv6(const struct sockaddr_in6 *restrict ip6, struct sockaddr_in *restrict ip4);
|
int rb_ipv4_from_ipv6(const struct sockaddr_in6 *__restrict__ ip6, struct sockaddr_in *__restrict__ ip4);
|
||||||
|
|
||||||
#endif /* INCLUDED_commio_h */
|
#endif /* INCLUDED_commio_h */
|
||||||
|
|
|
@ -278,7 +278,7 @@ rb_dlinkFindDestroy(void *data, rb_dlink_list *list)
|
||||||
|
|
||||||
if(ptr != NULL)
|
if(ptr != NULL)
|
||||||
{
|
{
|
||||||
rb_free_rb_dlink_node(ptr);
|
rb_free_rb_dlink_node((rb_dlink_node *)ptr);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -70,7 +70,7 @@ __attribute__((returns_nonnull))
|
||||||
static inline char *
|
static inline char *
|
||||||
rb_strndup(const char *x, size_t y)
|
rb_strndup(const char *x, size_t y)
|
||||||
{
|
{
|
||||||
char *ret = malloc(y);
|
char *ret = (char *)malloc(y);
|
||||||
if(rb_unlikely(ret == NULL))
|
if(rb_unlikely(ret == NULL))
|
||||||
rb_outofmemory();
|
rb_outofmemory();
|
||||||
rb_strlcpy(ret, x, y);
|
rb_strlcpy(ret, x, y);
|
||||||
|
@ -81,7 +81,7 @@ __attribute__((returns_nonnull))
|
||||||
static inline char *
|
static inline char *
|
||||||
rb_strdup(const char *x)
|
rb_strdup(const char *x)
|
||||||
{
|
{
|
||||||
char *ret = malloc(strlen(x) + 1);
|
char *ret = (char *)malloc(strlen(x) + 1);
|
||||||
if(rb_unlikely(ret == NULL))
|
if(rb_unlikely(ret == NULL))
|
||||||
rb_outofmemory();
|
rb_outofmemory();
|
||||||
strcpy(ret, x);
|
strcpy(ret, x);
|
||||||
|
|
Loading…
Reference in a new issue