grim/guifications2

Remove unnecessary GLIB_CHECK_VERSIONS
draft
2021-04-12, Gary Kramlich
7f30676c7038
Parents 2bcb53eb005d
Children fb28afae81c6
Remove unnecessary GLIB_CHECK_VERSIONS
--- a/src/gf_internal.h Mon Apr 12 18:16:46 2021 -0500
+++ b/src/gf_internal.h Mon Apr 12 18:23:57 2021 -0500
@@ -21,19 +21,7 @@
#include <glib.h>
-#if GLIB_CHECK_VERSION(2,4,0)
#include <glib/gi18n-lib.h>
-#else
-#include <locale.h>
-#include <libintl.h>
-#define _(String) dgettext (GETTEXT_PACKAGE, String)
-#define Q_(String) g_strip_context ((String), dgettext (GETTEXT_PACKAGE, String))
-#ifdef gettext_noop
-#define N_(String) gettext_noop (String)
-#else
-#define N_(String) (String)
-#endif
-#endif
/* This works around the lack of G_GNUC_NULL_TERMINATED in old glib and the
* lack of the NULL sentinel in GCC older than 4.0.0 and non-GCC compilers */
@@ -45,27 +33,12 @@
# endif
#endif
-#if GLIB_CHECK_VERSION(2,6,0)
-# include <glib/gstdio.h>
-#endif /* GLIB_CHECK_VERSION(2,6,0) */
+#include <glib/gstdio.h>
#ifdef _WIN32
# include <win32dep.h>
#endif /* _WIN32 */
-#if !GLIB_CHECK_VERSION(2,6,0)
-# define g_freopen freopen
-# define g_fopen fopen
-# define g_rmdir rmdir
-# define g_remove remove
-# define g_unlink unlink
-# define g_lstat lstat
-# define g_stat stat
-# define g_mkdir mkdir
-# define g_rename rename
-# define g_open open
-#endif /* !GLIB_CHECK_VERSION(2,6,0) */
-
#ifdef HAVE_CONFIG_H
# include "../gf_config.h"
#endif /* HAVE_CONFIG_H */
--- a/src/gf_item_text.c Mon Apr 12 18:16:46 2021 -0500
+++ b/src/gf_item_text.c Mon Apr 12 18:23:57 2021 -0500
@@ -629,31 +629,6 @@
return ret;
}
-/* ugly hack to keep us working on glib 2.0 */
-#if !GLIB_CHECK_VERSION(2,2,0)
-static gchar *
-g_utf8_strreverse(const gchar *str, gssize len) {
- gchar *result;
- const gchar *p;
- gchar *m, *r, skip;
-
- if (len < 0)
- len = strlen(str);
-
- result = g_new0(gchar, len + 1);
- r = result + len;
- p = str;
- while (*p) {
- skip = g_utf8_skip[*(guchar*)p];
- r -= skip;
- for (m = r; skip; skip--)
- *m++ = *p++;
- }
-
- return result;
-}
-#endif
-
/* this will probably break.. be sure to test it!!! */
static gchar *
gf_utf8_strrndup(const gchar *text, gint n) {