From 4e9b73a19182aea1f14dd0d3f404ca13bcdb560d Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 24 Sep 2024 14:10:17 +0300 Subject: [PATCH] Drop usage of binary compatibility function versions. Fix #11 --- src/glib-convert.adb | 8 +++---- src/misc.c | 55 -------------------------------------------- 2 files changed, 4 insertions(+), 59 deletions(-) diff --git a/src/glib-convert.adb b/src/glib-convert.adb index e3ea738fc..bae019ac1 100644 --- a/src/glib-convert.adb +++ b/src/glib-convert.adb @@ -129,7 +129,7 @@ package body Glib.Convert is (URI : String; Hostname : access Gtkada.Types.Chars_Ptr; Error : GError_Access) return Gtkada.Types.Chars_Ptr; - pragma Import (C, Internal, "ada_g_filename_from_uri"); + pragma Import (C, Internal, "g_filename_from_uri"); S : Gtkada.Types.Chars_Ptr := Internal (URI & ASCII.NUL, Hostname, Error); @@ -154,7 +154,7 @@ package body Glib.Convert is Bytes_Read : System.Address := System.Null_Address; Bytes_Written : System.Address := System.Null_Address; Error : GError_Access) return Gtkada.Types.Chars_Ptr; - pragma Import (C, Internal, "ada_g_filename_from_utf8"); + pragma Import (C, Internal, "g_filename_from_utf8"); S : Gtkada.Types.Chars_Ptr := Internal (UTF8_String, UTF8_String'Length, Error => Error); @@ -178,7 +178,7 @@ package body Glib.Convert is (URI : String; Hostname : System.Address; Error : GError_Access) return Gtkada.Types.Chars_Ptr; - pragma Import (C, Internal, "ada_g_filename_to_uri"); + pragma Import (C, Internal, "g_filename_to_uri"); S : Gtkada.Types.Chars_Ptr; Host : aliased constant String := Hostname & ASCII.NUL; @@ -212,7 +212,7 @@ package body Glib.Convert is Bytes_Read : System.Address := System.Null_Address; Bytes_Written : System.Address := System.Null_Address; Error : GError_Access) return Gtkada.Types.Chars_Ptr; - pragma Import (C, Internal, "ada_g_filename_to_utf8"); + pragma Import (C, Internal, "g_filename_to_utf8"); S : Gtkada.Types.Chars_Ptr := Internal (OS_String, OS_String'Length, Error => Error); diff --git a/src/misc.c b/src/misc.c index 18a80c7b3..5a1ce55f9 100644 --- a/src/misc.c +++ b/src/misc.c @@ -81,61 +81,6 @@ ada_gtk_micro_version () ** wrappers for functions which vary on Windows ********************************************************************/ -gchar * -ada_g_filename_from_uri (const gchar *uri, - gchar **hostname, - GError **error) { -#ifdef GDK_WINDOWING_WIN32 - return g_filename_from_uri_utf8 (uri, hostname, error); -#else - return g_filename_from_uri (uri, hostname, error); -#endif -} - -gchar * -ada_g_filename_from_utf8 (const gchar *utf8string, - gssize len, - gsize *bytes_read, - gsize *bytes_written, - GError **error) -{ -#ifdef GDK_WINDOWING_WIN32 - return g_filename_from_utf8_utf8 - (utf8string, len, bytes_read, bytes_written, error); -#else - return g_filename_from_utf8 - (utf8string, len, bytes_read, bytes_written, error); -#endif -} - -gchar * -ada_g_filename_to_uri (const gchar *filename, - const gchar *hostname, - GError **error) -{ -#ifdef GDK_WINDOWING_WIN32 - return g_filename_to_uri_utf8 (filename, hostname, error); -#else - return g_filename_to_uri (filename, hostname, error); -#endif -} - -gchar * -ada_g_filename_to_utf8 (const gchar *opsysstring, - gssize len, - gsize *bytes_read, - gsize *bytes_written, - GError **error) -{ -#ifdef GDK_WINDOWING_WIN32 - return g_filename_to_utf8_utf8 - (opsysstring, len, bytes_read, bytes_written, error); -#else - return g_filename_to_utf8 - (opsysstring, len, bytes_read, bytes_written, error); -#endif -} - GdkPixbuf * ada_gdk_pixbuf_new_from_file (const char *filename, GError **error)