mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-12-06 06:51:53 +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
@@ -14,6 +14,7 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define _POSIX_C_SOURCE 200809L
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -25,7 +26,7 @@ int xs_parse_df(gint64 *out_total, gint64 *out_free)
|
|||||||
{
|
{
|
||||||
FILE *pipe;
|
FILE *pipe;
|
||||||
char buffer[bsize];
|
char buffer[bsize];
|
||||||
|
|
||||||
pipe = popen("df -k -l -P --exclude-type=squashfs --exclude-type=devtmpfs --exclude-type=tmpfs", "r");
|
pipe = popen("df -k -l -P --exclude-type=squashfs --exclude-type=devtmpfs --exclude-type=tmpfs", "r");
|
||||||
if(pipe==NULL)
|
if(pipe==NULL)
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
+23
-22
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
/* IRC RFC1459(+commonly used extensions) protocol implementation */
|
/* IRC RFC1459(+commonly used extensions) protocol implementation */
|
||||||
|
|
||||||
|
#define _POSIX_C_SOURCE 200809L
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -492,7 +493,7 @@ process_numeric (session * sess, int n,
|
|||||||
server *serv = sess->server;
|
server *serv = sess->server;
|
||||||
/* show whois is the server tab */
|
/* show whois is the server tab */
|
||||||
session *whois_sess = serv->server_session;
|
session *whois_sess = serv->server_session;
|
||||||
|
|
||||||
/* unless this setting is on */
|
/* unless this setting is on */
|
||||||
if (prefs.hex_irc_whois_front)
|
if (prefs.hex_irc_whois_front)
|
||||||
whois_sess = serv->front_session;
|
whois_sess = serv->front_session;
|
||||||
@@ -663,7 +664,7 @@ process_numeric (session * sess, int n,
|
|||||||
|
|
||||||
case 323:
|
case 323:
|
||||||
if (!fe_is_chanwindow (sess->server))
|
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);
|
word[1], word[2], NULL, 0, tags_data->timestamp);
|
||||||
else
|
else
|
||||||
fe_chan_list_end (sess->server);
|
fe_chan_list_end (sess->server);
|
||||||
@@ -693,7 +694,7 @@ process_numeric (session * sess, int n,
|
|||||||
if (sess)
|
if (sess)
|
||||||
{
|
{
|
||||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANURL, sess, word[4], (word_eol[5][0] == ':') ? word_eol[5] + 1 : word_eol[5],
|
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;
|
break;
|
||||||
|
|
||||||
@@ -729,7 +730,7 @@ process_numeric (session * sess, int n,
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
case 338: /* Undernet Real user@host, Real IP */
|
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],
|
(word_eol[7][0]==':') ? word_eol[7]+1 : word_eol[7],
|
||||||
0, tags_data->timestamp);
|
0, tags_data->timestamp);
|
||||||
break;
|
break;
|
||||||
@@ -962,7 +963,7 @@ process_numeric (session * sess, int n,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 900: /* successful SASL 'logged in as ' */
|
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,
|
word_eol[6]+1, word[1], word[2], NULL, 0,
|
||||||
tags_data->timestamp);
|
tags_data->timestamp);
|
||||||
break;
|
break;
|
||||||
@@ -1001,7 +1002,7 @@ process_numeric (session * sess, int n,
|
|||||||
def:
|
def:
|
||||||
{
|
{
|
||||||
session *sess;
|
session *sess;
|
||||||
|
|
||||||
if (is_channel (serv, word[4]))
|
if (is_channel (serv, word[4]))
|
||||||
{
|
{
|
||||||
sess = find_channel (serv, word[4]);
|
sess = find_channel (serv, word[4]);
|
||||||
@@ -1012,7 +1013,7 @@ process_numeric (session * sess, int n,
|
|||||||
;
|
;
|
||||||
else
|
else
|
||||||
sess=serv->server_session;
|
sess=serv->server_session;
|
||||||
|
|
||||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, sess, text, word[1], word[2],
|
EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, sess, text, word[1], word[2],
|
||||||
NULL, 0, tags_data->timestamp);
|
NULL, 0, tags_data->timestamp);
|
||||||
}
|
}
|
||||||
@@ -1091,7 +1092,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
|
|||||||
{
|
{
|
||||||
guint32 t;
|
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 */
|
/* this should compile to a bunch of: CMP.L, JE ... nice & fast */
|
||||||
switch (t)
|
switch (t)
|
||||||
{
|
{
|
||||||
@@ -1147,7 +1148,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case WORDL('N','I','C','K'):
|
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],
|
(word_eol[3][0] == ':') ? word_eol[3] + 1 : word_eol[3],
|
||||||
FALSE, tags_data);
|
FALSE, tags_data);
|
||||||
return;
|
return;
|
||||||
@@ -1231,7 +1232,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
|
|||||||
{
|
{
|
||||||
guint32 t;
|
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 */
|
/* this should compile to a bunch of: CMP.L, JE ... nice & fast */
|
||||||
switch (t)
|
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,
|
EMIT_SIGNAL_TIMESTAMP (XP_TE_INVITED, sess, text, nick,
|
||||||
serv->servername, NULL, 0,
|
serv->servername, NULL, 0,
|
||||||
tags_data->timestamp);
|
tags_data->timestamp);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case WORDL('N','O','T','I'):
|
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
|
if (strchr (serv->chantypes, to[0]) == NULL
|
||||||
&& strchr (serv->nick_prefixes, to[0]) != NULL)
|
&& strchr (serv->nick_prefixes, to[0]) != NULL)
|
||||||
to++;
|
to++;
|
||||||
|
|
||||||
text = word_eol[4];
|
text = word_eol[4];
|
||||||
if (*text == ':')
|
if (*text == ':')
|
||||||
text++;
|
text++;
|
||||||
@@ -1442,13 +1443,13 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
|
|||||||
case WORDL('C','A','P','\0'):
|
case WORDL('C','A','P','\0'):
|
||||||
if (g_ascii_strncasecmp(word[4], "ACK", 3) == 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],
|
word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
|
||||||
tags_data);
|
tags_data);
|
||||||
}
|
}
|
||||||
else if (g_ascii_strncasecmp(word[4], "LS", 2) == 0)
|
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],
|
word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
|
||||||
tags_data);
|
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);
|
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],
|
word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
|
||||||
tags_data);
|
tags_data);
|
||||||
}
|
}
|
||||||
@@ -1508,7 +1509,7 @@ process_named_servermsg (session *sess, char *buf, char *rawname, char *word_eol
|
|||||||
buf = word_eol[3];
|
buf = word_eol[3];
|
||||||
if (*buf == ':')
|
if (*buf == ':')
|
||||||
buf++;
|
buf++;
|
||||||
EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVNOTICE, sess, buf,
|
EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVNOTICE, sess, buf,
|
||||||
sess->server->servername, NULL, NULL, 0,
|
sess->server->servername, NULL, NULL, 0,
|
||||||
tags_data->timestamp);
|
tags_data->timestamp);
|
||||||
return;
|
return;
|
||||||
@@ -1557,8 +1558,8 @@ get_timezone (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Handle time-server tags.
|
/* 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.
|
* This received time is always in UTC.
|
||||||
*
|
*
|
||||||
* See http://ircv3.atheme.org/extensions/server-time-3.2
|
* 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)
|
if (!*time)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (time[strlen (time) - 1] == 'Z')
|
if (time[strlen (time) - 1] == 'Z')
|
||||||
{
|
{
|
||||||
/* as defined in the specification */
|
/* as defined in the specification */
|
||||||
@@ -1623,7 +1624,7 @@ handle_message_tag_time (const char *time, message_tags_data *tags_data)
|
|||||||
|
|
||||||
/* Handle message tags.
|
/* 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 *
|
static char *
|
||||||
message_tag_unescape (const char *value)
|
message_tag_unescape (const char *value)
|
||||||
@@ -1778,7 +1779,7 @@ irc_inline (server *serv, char *buf, int len)
|
|||||||
|
|
||||||
if (!sep)
|
if (!sep)
|
||||||
goto xit;
|
goto xit;
|
||||||
|
|
||||||
*sep = '\0';
|
*sep = '\0';
|
||||||
buf = sep + 1;
|
buf = sep + 1;
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -21,6 +21,10 @@
|
|||||||
* Inferno Nettverk A/S, Norway. All rights reserved.
|
* Inferno Nettverk A/S, Norway. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
#define _POSIX_C_SOURCE 200809L
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -1804,7 +1808,7 @@ server_set_encoding (server *serv, char *new_encoding)
|
|||||||
if (new_encoding)
|
if (new_encoding)
|
||||||
{
|
{
|
||||||
serv->encoding = g_strdup (new_encoding);
|
serv->encoding = g_strdup (new_encoding);
|
||||||
/* the serverlist GUI might have added a space
|
/* the serverlist GUI might have added a space
|
||||||
and short description - remove it. */
|
and short description - remove it. */
|
||||||
space = strchr (serv->encoding, ' ');
|
space = strchr (serv->encoding, ' ');
|
||||||
if (space)
|
if (space)
|
||||||
|
|||||||
@@ -16,6 +16,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
#define _POSIX_C_SOURCE 200809L
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -308,7 +312,7 @@ lastact_getfirst(int (*filter) (session *sess))
|
|||||||
sess->lastact_idx = LACT_NONE;
|
sess->lastact_idx = LACT_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return sess;
|
return sess;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,7 +364,7 @@ lagcheck_update (void)
|
|||||||
{
|
{
|
||||||
server *serv;
|
server *serv;
|
||||||
GSList *list = serv_list;
|
GSList *list = serv_list;
|
||||||
|
|
||||||
if (!prefs.hex_gui_lagometer)
|
if (!prefs.hex_gui_lagometer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -575,7 +579,7 @@ irc_init (session *sess)
|
|||||||
g_free (buf);
|
g_free (buf);
|
||||||
g_free (arg_url);
|
g_free (arg_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg_urls != NULL)
|
if (arg_urls != NULL)
|
||||||
{
|
{
|
||||||
guint i;
|
guint i;
|
||||||
@@ -896,7 +900,7 @@ static char defaultconf_urlhandlers[] =
|
|||||||
#ifdef USE_SIGACTION
|
#ifdef USE_SIGACTION
|
||||||
/* Close and open log files on SIGUSR1. Usefull for log rotating */
|
/* Close and open log files on SIGUSR1. Usefull for log rotating */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sigusr1_handler (int signal, siginfo_t *si, void *un)
|
sigusr1_handler (int signal, siginfo_t *si, void *un)
|
||||||
{
|
{
|
||||||
GSList *list = sess_list;
|
GSList *list = sess_list;
|
||||||
|
|||||||
Reference in new issue
Block a user