diff options
author | Mike Ruprecht <cmaiku@gmail.com> | 2016-09-14 09:46:51 -0500 |
---|---|---|
committer | Mike Ruprecht <cmaiku@gmail.com> | 2016-09-14 09:46:51 -0500 |
commit | 5f365f4edfa740babbe216c0921cf01f3fc69a27 (patch) | |
tree | abd785ccefc6752f872a5fa4008162bb843721a0 | |
parent | 78afe5b1760e2552f993b48bb633613f72a42396 (diff) | |
download | pidgin-5f365f4edfa740babbe216c0921cf01f3fc69a27.tar.gz |
Remove GLIB_CHECK_VERSION <= 2.36 calls
This patch removes GLIB_CHECK_VERSION calls for versions 2.36 and
lower as we now depend on version 2.36. There is still a guard in
libgnt, but I figured it's not dependent on libpurple, so its
glib dependency could potentially be less.
-rw-r--r-- | finch/finch.c | 8 | ||||
-rw-r--r-- | libpurple/core.c | 5 | ||||
-rw-r--r-- | libpurple/glibcompat.h | 31 | ||||
-rw-r--r-- | libpurple/plugins/caesarcipher.c | 4 | ||||
-rw-r--r-- | libpurple/purple-client.c | 5 | ||||
-rw-r--r-- | libpurple/util.c | 13 | ||||
-rw-r--r-- | libpurple/win32/win32dep.c | 9 | ||||
-rw-r--r-- | pidgin/gtkdebug.c | 6 | ||||
-rw-r--r-- | pidgin/pidgin.c | 8 |
9 files changed, 3 insertions, 86 deletions
diff --git a/finch/finch.c b/finch/finch.c index bd90170a0b..a0b06044b1 100644 --- a/finch/finch.c +++ b/finch/finch.c @@ -32,14 +32,6 @@ int main(int argc, char *argv[]) signal(SIGPIPE, SIG_IGN); #endif -#if !GLIB_CHECK_VERSION(2, 32, 0) - /* GLib threading system is automaticaly initialized since 2.32. - * For earlier versions, it have to be initialized before calling any - * Glib or GTK+ functions. - */ - g_thread_init(NULL); -#endif - g_set_prgname("Finch"); g_set_application_name(_("Finch")); diff --git a/libpurple/core.c b/libpurple/core.c index 554ff73372..53ced2bad6 100644 --- a/libpurple/core.c +++ b/libpurple/core.c @@ -113,11 +113,6 @@ purple_core_init(const char *ui) wpurple_init(); #endif -#if !GLIB_CHECK_VERSION(2, 36, 0) - /* GLib type system is automaticaly initialized since 2.36. */ - g_type_init(); -#endif - _core = core = g_new0(PurpleCore, 1); core->ui = g_strdup(ui); core->reserved = NULL; diff --git a/libpurple/glibcompat.h b/libpurple/glibcompat.h index 4fbf6bc237..b008964513 100644 --- a/libpurple/glibcompat.h +++ b/libpurple/glibcompat.h @@ -33,37 +33,6 @@ #include <glib.h> -#if !GLIB_CHECK_VERSION(2, 36, 0) - -#include <errno.h> -#include <fcntl.h> -#ifndef _WIN32 -#include <unistd.h> -#endif - -static inline gboolean g_close(gint fd, GError **error) -{ - int res; - int errsv; - - res = close(fd); - - if (G_LIKELY(res == 0)) - return TRUE; - if (G_UNLIKELY(errno == EINTR)) - return TRUE; - - errsv = errno; - g_set_error_literal(error, G_FILE_ERROR, - g_file_error_from_errno(errsv), g_strerror(errsv)); - errno = errsv; - - return FALSE; -} - -#endif /* < 2.36.0 */ - - /* glib's definition of g_stat+GStatBuf seems to be broken on mingw64-w32 (and * possibly other 32-bit windows), so instead of relying on it, * we'll define our own. diff --git a/libpurple/plugins/caesarcipher.c b/libpurple/plugins/caesarcipher.c index 0d9ae7bf0f..0c79589b5a 100644 --- a/libpurple/plugins/caesarcipher.c +++ b/libpurple/plugins/caesarcipher.c @@ -117,11 +117,7 @@ caesar_cipher_set_property(GObject *obj, guint param_id, const GValue *value, switch(param_id) { case PROP_OFFSET: -#if GLIB_CHECK_VERSION(2, 32, 0) caesar_cipher_set_offset(cipher, g_value_get_schar(value)); -#else - caesar_cipher_set_offset(cipher, g_value_get_char(value)); -#endif break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); diff --git a/libpurple/purple-client.c b/libpurple/purple-client.c index a0d4f48372..5f86e3a96c 100644 --- a/libpurple/purple-client.c +++ b/libpurple/purple-client.c @@ -66,11 +66,6 @@ void purple_init(void) { GError *error = NULL; -#if !GLIB_CHECK_VERSION(2, 36, 0) - /* GLib type system is automaticaly initialized since 2.36. */ - g_type_init(); -#endif - bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (!bus) lose_gerror ("Couldn't connect to session bus", error); diff --git a/libpurple/util.c b/libpurple/util.c index f46ff390c6..fe416c6d31 100644 --- a/libpurple/util.c +++ b/libpurple/util.c @@ -4260,11 +4260,7 @@ purple_utf8_strip_unprintables(const gchar *str) const gchar * purple_gai_strerror(gint errnum) { -#if GLIB_CHECK_VERSION(2, 32, 0) static GPrivate msg_private = G_PRIVATE_INIT(g_free); -#else - static GStaticPrivate msg_private = G_STATIC_PRIVATE_INIT; -#endif char *msg; int saved_errno = errno; @@ -4292,19 +4288,12 @@ purple_gai_strerror(gint errnum) } } -#if GLIB_CHECK_VERSION(2, 32, 0) msg = g_private_get(&msg_private); -#else - msg = g_static_private_get(&msg_private); -#endif + if (!msg) { msg = g_new(gchar, 64); -#if GLIB_CHECK_VERSION(2, 32, 0) g_private_set(&msg_private, msg); -#else - g_static_private_set(&msg_private, msg, g_free); -#endif } sprintf(msg, "unknown error (%d)", errnum); diff --git a/libpurple/win32/win32dep.c b/libpurple/win32/win32dep.c index 6ca5e737f5..37537cb664 100644 --- a/libpurple/win32/win32dep.c +++ b/libpurple/win32/win32dep.c @@ -622,15 +622,6 @@ void wpurple_init(void) { WORD wVersionRequested; WSADATA wsaData; -#if !GLIB_CHECK_VERSION(2, 32, 0) - /* GLib threading system is automaticaly initialized since 2.32. - * For earlier versions, it have to be initialized before calling any - * Glib or GTK+ functions. - */ - if (!g_thread_supported()) - g_thread_init(NULL); -#endif - if (purple_debug_is_verbose()) purple_debug_misc("wpurple", "wpurple_init start\n"); diff --git a/pidgin/gtkdebug.c b/pidgin/gtkdebug.c index 6be06780a8..2d9513452e 100644 --- a/pidgin/gtkdebug.c +++ b/pidgin/gtkdebug.c @@ -273,11 +273,9 @@ regex_changed_cb(GtkWidget *w, DebugWindow *win) { if (win->regex) g_regex_unref(win->regex); -#if GLIB_CHECK_VERSION(2,34,0) + win->regex = g_regex_new(text, G_REGEX_CASELESS|G_REGEX_JAVASCRIPT_COMPAT, 0, NULL); -#else - win->regex = g_regex_new(text, G_REGEX_CASELESS, 0, NULL); -#endif + if (win->regex == NULL) { /* failed to compile */ regex_change_color(win->expression, FALSE); diff --git a/pidgin/pidgin.c b/pidgin/pidgin.c index 755fbe3646..9cf72f7a73 100644 --- a/pidgin/pidgin.c +++ b/pidgin/pidgin.c @@ -38,14 +38,6 @@ int main(int argc, char *argv[]) SetConsoleOutputCP(65001); /* UTF-8 */ #endif -#if !GLIB_CHECK_VERSION(2, 32, 0) - /* GLib threading system is automaticaly initialized since 2.32. - * For earlier versions, it have to be initialized before calling any - * Glib or GTK+ functions. - */ - g_thread_init(NULL); -#endif - /* This is for UI testing purposes only, don't use it! */ test_prgname = g_getenv("PIDGIN_TEST_PRGNAME"); g_set_prgname(test_prgname ? test_prgname : "Pidgin"); |