mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-12-05 14:31:49 +00:00
Fix building on Chimera Linux (and other similar operating systems)
zoitechat references kill, popen, pclose, gmtime_r, and localtime_r which are POSIX-only functions that need #define _POSIX_SOURCE to build with LLVM or musl C, one of the two.
This commit is contained in:
1 parent
84ffab7158
commit
f4f515d212
4 files changed
+38
-28
No files matched your search
+23
-22
@@ -18,6 +18,7 @@
|
||||
|
||||
/* IRC RFC1459(+commonly used extensions) protocol implementation */
|
||||
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -492,7 +493,7 @@ process_numeric (session * sess, int n,
|
||||
server *serv = sess->server;
|
||||
/* show whois is the server tab */
|
||||
session *whois_sess = serv->server_session;
|
||||
|
||||
|
||||
/* unless this setting is on */
|
||||
if (prefs.hex_irc_whois_front)
|
||||
whois_sess = serv->front_session;
|
||||
@@ -663,7 +664,7 @@ process_numeric (session * sess, int n,
|
||||
|
||||
case 323:
|
||||
if (!fe_is_chanwindow (sess->server))
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, serv->server_session, text,
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, serv->server_session, text,
|
||||
word[1], word[2], NULL, 0, tags_data->timestamp);
|
||||
else
|
||||
fe_chan_list_end (sess->server);
|
||||
@@ -693,7 +694,7 @@ process_numeric (session * sess, int n,
|
||||
if (sess)
|
||||
{
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANURL, sess, word[4], (word_eol[5][0] == ':') ? word_eol[5] + 1 : word_eol[5],
|
||||
NULL, NULL, 0, tags_data->timestamp);
|
||||
NULL, NULL, 0, tags_data->timestamp);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -729,7 +730,7 @@ process_numeric (session * sess, int n,
|
||||
|
||||
#if 0
|
||||
case 338: /* Undernet Real user@host, Real IP */
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS_REALHOST, sess, word[4], word[5], word[6],
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS_REALHOST, sess, word[4], word[5], word[6],
|
||||
(word_eol[7][0]==':') ? word_eol[7]+1 : word_eol[7],
|
||||
0, tags_data->timestamp);
|
||||
break;
|
||||
@@ -962,7 +963,7 @@ process_numeric (session * sess, int n,
|
||||
break;
|
||||
|
||||
case 900: /* successful SASL 'logged in as ' */
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, serv->server_session,
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, serv->server_session,
|
||||
word_eol[6]+1, word[1], word[2], NULL, 0,
|
||||
tags_data->timestamp);
|
||||
break;
|
||||
@@ -1001,7 +1002,7 @@ process_numeric (session * sess, int n,
|
||||
def:
|
||||
{
|
||||
session *sess;
|
||||
|
||||
|
||||
if (is_channel (serv, word[4]))
|
||||
{
|
||||
sess = find_channel (serv, word[4]);
|
||||
@@ -1012,7 +1013,7 @@ process_numeric (session * sess, int n,
|
||||
;
|
||||
else
|
||||
sess=serv->server_session;
|
||||
|
||||
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, sess, text, word[1], word[2],
|
||||
NULL, 0, tags_data->timestamp);
|
||||
}
|
||||
@@ -1091,7 +1092,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
|
||||
{
|
||||
guint32 t;
|
||||
|
||||
t = WORDL((guint8)type[0], (guint8)type[1], (guint8)type[2], (guint8)type[3]);
|
||||
t = WORDL((guint8)type[0], (guint8)type[1], (guint8)type[2], (guint8)type[3]);
|
||||
/* this should compile to a bunch of: CMP.L, JE ... nice & fast */
|
||||
switch (t)
|
||||
{
|
||||
@@ -1147,7 +1148,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
|
||||
return;
|
||||
|
||||
case WORDL('N','I','C','K'):
|
||||
inbound_newnick (serv, nick,
|
||||
inbound_newnick (serv, nick,
|
||||
(word_eol[3][0] == ':') ? word_eol[3] + 1 : word_eol[3],
|
||||
FALSE, tags_data);
|
||||
return;
|
||||
@@ -1231,7 +1232,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
|
||||
{
|
||||
guint32 t;
|
||||
|
||||
t = WORDL((guint8)type[0], (guint8)type[1], (guint8)type[2], (guint8)type[3]);
|
||||
t = WORDL((guint8)type[0], (guint8)type[1], (guint8)type[2], (guint8)type[3]);
|
||||
/* this should compile to a bunch of: CMP.L, JE ... nice & fast */
|
||||
switch (t)
|
||||
{
|
||||
@@ -1267,7 +1268,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_INVITED, sess, text, nick,
|
||||
serv->servername, NULL, 0,
|
||||
tags_data->timestamp);
|
||||
|
||||
|
||||
return;
|
||||
|
||||
case WORDL('N','O','T','I'):
|
||||
@@ -1320,7 +1321,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
|
||||
if (strchr (serv->chantypes, to[0]) == NULL
|
||||
&& strchr (serv->nick_prefixes, to[0]) != NULL)
|
||||
to++;
|
||||
|
||||
|
||||
text = word_eol[4];
|
||||
if (*text == ':')
|
||||
text++;
|
||||
@@ -1442,13 +1443,13 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
|
||||
case WORDL('C','A','P','\0'):
|
||||
if (g_ascii_strncasecmp(word[4], "ACK", 3) == 0)
|
||||
{
|
||||
inbound_cap_ack (serv, word[1],
|
||||
inbound_cap_ack (serv, word[1],
|
||||
word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
|
||||
tags_data);
|
||||
}
|
||||
else if (g_ascii_strncasecmp(word[4], "LS", 2) == 0)
|
||||
{
|
||||
inbound_cap_ls (serv, word[1],
|
||||
inbound_cap_ls (serv, word[1],
|
||||
word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
|
||||
tags_data);
|
||||
}
|
||||
@@ -1462,9 +1463,9 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
|
||||
{
|
||||
inbound_cap_nak (serv, word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5], tags_data);
|
||||
}
|
||||
else if (g_ascii_strncasecmp(word[4], "LIST", 4) == 0)
|
||||
else if (g_ascii_strncasecmp(word[4], "LIST", 4) == 0)
|
||||
{
|
||||
inbound_cap_list (serv, word[1],
|
||||
inbound_cap_list (serv, word[1],
|
||||
word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
|
||||
tags_data);
|
||||
}
|
||||
@@ -1508,7 +1509,7 @@ process_named_servermsg (session *sess, char *buf, char *rawname, char *word_eol
|
||||
buf = word_eol[3];
|
||||
if (*buf == ':')
|
||||
buf++;
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVNOTICE, sess, buf,
|
||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVNOTICE, sess, buf,
|
||||
sess->server->servername, NULL, NULL, 0,
|
||||
tags_data->timestamp);
|
||||
return;
|
||||
@@ -1557,8 +1558,8 @@ get_timezone (void)
|
||||
}
|
||||
|
||||
/* Handle time-server tags.
|
||||
*
|
||||
* Sets tags_data->timestamp to the correct time (in unix time).
|
||||
*
|
||||
* Sets tags_data->timestamp to the correct time (in unix time).
|
||||
* This received time is always in UTC.
|
||||
*
|
||||
* See http://ircv3.atheme.org/extensions/server-time-3.2
|
||||
@@ -1573,7 +1574,7 @@ handle_message_tag_time (const char *time, message_tags_data *tags_data)
|
||||
*/
|
||||
if (!*time)
|
||||
return;
|
||||
|
||||
|
||||
if (time[strlen (time) - 1] == 'Z')
|
||||
{
|
||||
/* as defined in the specification */
|
||||
@@ -1623,7 +1624,7 @@ handle_message_tag_time (const char *time, message_tags_data *tags_data)
|
||||
|
||||
/* Handle message tags.
|
||||
*
|
||||
* See http://ircv3.atheme.org/specification/message-tags-3.2
|
||||
* See http://ircv3.atheme.org/specification/message-tags-3.2
|
||||
*/
|
||||
static char *
|
||||
message_tag_unescape (const char *value)
|
||||
@@ -1778,7 +1779,7 @@ irc_inline (server *serv, char *buf, int len)
|
||||
|
||||
if (!sep)
|
||||
goto xit;
|
||||
|
||||
|
||||
*sep = '\0';
|
||||
buf = sep + 1;
|
||||
|
||||
|
||||
Reference in new issue
Block a user