mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 04:46:37 +02:00
Fix compilation bug when gnutls dev lib is not installed
This commit is contained in:
@@ -798,6 +798,11 @@ hook_connect (struct t_weechat_plugin *plugin, char *address, int port,
|
||||
struct t_hook *new_hook;
|
||||
struct t_hook_connect *new_hook_connect;
|
||||
|
||||
#ifndef HAVE_GNUTLS
|
||||
/* make C compiler happy */
|
||||
(void) gnutls_sess;
|
||||
#endif
|
||||
|
||||
if ((sock < 0) || !address || (port <= 0))
|
||||
return NULL;
|
||||
|
||||
@@ -819,7 +824,9 @@ hook_connect (struct t_weechat_plugin *plugin, char *address, int port,
|
||||
new_hook_connect->port = port;
|
||||
new_hook_connect->sock = sock;
|
||||
new_hook_connect->ipv6 = ipv6;
|
||||
#ifdef HAVE_GNUTLS
|
||||
new_hook_connect->gnutls_sess = gnutls_sess;
|
||||
#endif
|
||||
new_hook_connect->local_hostname = (local_hostname) ?
|
||||
strdup (local_hostname) : NULL;
|
||||
new_hook_connect->child_read = -1;
|
||||
|
||||
@@ -679,7 +679,10 @@ network_connect_child_read_cb (void *arg_hook_connect)
|
||||
{
|
||||
struct t_hook *hook_connect;
|
||||
char buffer[1];
|
||||
int num_read, rc;
|
||||
int num_read;
|
||||
#ifdef HAVE_GNUTLS
|
||||
int rc;
|
||||
#endif
|
||||
|
||||
hook_connect = (struct t_hook *)arg_hook_connect;
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
@@ -1967,7 +1968,11 @@ irc_server_connect (struct t_irc_server *server, int disable_autojoin)
|
||||
server->ports_array[server->current_address],
|
||||
server->sock,
|
||||
server->ipv6,
|
||||
#ifdef HAVE_GNUTLS
|
||||
(server->ssl_connected) ? &server->gnutls_sess : NULL,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
server->local_hostname,
|
||||
irc_server_connect_cb,
|
||||
server);
|
||||
|
||||
Reference in New Issue
Block a user