#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
int g_timeval_cmp(const GTimeVal *tv1, const GTimeVal *tv2)
{
-#pragma GCC diagnostic pop
if (tv1->tv_sec < tv2->tv_sec)
return -1;
if (tv1->tv_sec > tv2->tv_sec)
tv1->tv_usec > tv2->tv_usec ? 1 : 0;
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
long get_timeval_diff(const GTimeVal *tv1, const GTimeVal *tv2)
{
-#pragma GCC diagnostic pop
long secs, usecs;
secs = tv1->tv_sec - tv2->tv_sec;
return usecs;
}
+#pragma GCC diagnostic pop
+
+#if GLIB_CHECK_VERSION(2, 56, 0)
+/* nothing */
+#else
+/* compatibility code for old GLib */
+GDateTime *g_date_time_new_from_iso8601(const gchar *iso_date, GTimeZone *default_tz)
+{
+ GTimeVal time;
+ if (g_time_val_from_iso8601(iso_date, &time)) {
+ return g_date_time_new_from_timeval_utc(&time);
+ } else {
+ return NULL;
+ }
+}
+#endif
int find_substr(const char *list, const char *item)
{
long get_timeval_diff(const GTimeVal *tv1, const GTimeVal *tv2) G_GNUC_DEPRECATED;
#pragma GCC diagnostic pop
+#if GLIB_CHECK_VERSION(2, 56, 0)
+/* nothing */
+#else
+/* compatibility code for old GLib */
+GDateTime *g_date_time_new_from_iso8601(const gchar *iso_date, GTimeZone *default_tz);
+#endif
+
GSList *i_slist_find_string(GSList *list, const char *key);
GSList *i_slist_find_icase_string(GSList *list, const char *key);
GList *i_list_find_string(GList *list, const char *key);
#include "module.h"
#include <irssi/src/core/expandos.h>
#include <irssi/src/core/levels.h>
+#include <irssi/src/core/misc.h>
#include <irssi/src/core/refstrings.h>
#include <irssi/src/core/servers.h>
#include <irssi/src/core/settings.h>
gboolean show_server_time;
int signal_gui_render_line_text;
-#if GLIB_CHECK_VERSION(2, 56, 0)
-/* nothing */
-#else
-/* compatibility code for old GLib */
-static GDateTime *g_date_time_new_from_iso8601(const gchar *iso_date, GTimeZone *default_tz)
-{
- GTimeVal time;
- if (g_time_val_from_iso8601(iso_date, &time)) {
- return g_date_time_new_from_timeval_utc(&time);
- } else {
- return NULL;
- }
-}
-#endif
-
static void collector_free(GSList **collector)
{
while (*collector) {