Re: GLib file name encoding (Was: Please join me...)



On Fri, Jan 21, 2005 at 11:52:33PM +0000, Tor Lillqvist wrote:

...
  To keep binary compatibility with applications compiled against
  older versions of GLib, the Windows DLL still provides entry points
  with the old semantics using the old names, and applications
  compiled against GLib 2.6 will actually use new names for the
  functions. This is transparent to the programmer.

  When compiling against GLib 2.6, applications intended to be
  portable to Windows must take the UTF-8 file name encoding into
  consideration, and use the gstdio wrappers to access files whose
  names have been constructed from strings returned from GLib.
...

I don't know which Gtk+ version will people compile my app
with.

How can I write code so that it is source compatible with
GLib and Gtk+ from 2.2 to 2.6+ without branching by GLib
(Gtk+) version?  (I really don't like the idea of writing
portability wrappers around portability wrappers...)

As I understand it, I can't use

1. g_fopen() because it doesn't exist in GLib < 2.6

2. (this is what I do now)
   g_filename_from_utf8() + fopen() because g_filename_from_utf8()
   is noop in 2.6 so fopen() would try to open UTF-8 name

Or maybe I misunderstand the new names and old names in the
first paragraph (I don't know if symbol versioning is even
possible on MS Windows).

Yeti


--
Dynamic IP address is not a crime.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]