Skip to content

Commit

Permalink
Merge branch 'topic/fix_win' into '24.0'
Browse files Browse the repository at this point in the history
Drop usage of binary compatibility function versions.

See merge request eng/ide/gtkada!22
  • Loading branch information
reznikmm committed Sep 24, 2024
2 parents b17054b + 4e9b73a commit 55eef2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 59 deletions.
8 changes: 4 additions & 4 deletions src/glib-convert.adb
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
55 changes: 0 additions & 55 deletions src/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 55eef2a

Please sign in to comment.