Op 01/28/2010 10:46 PM, Tor Lillqvist schreef:
> OK, thanks for the information. So the "magic" will work for the
> message catalogs of the executable but not for those of a DLL if it is
> installed in a different prefix?
> (If you have an executable in foo/bin/foo.exe, a library in
> bar/bin/libbar.dll, with libbar's message catalog in bar/share/locale,
> and libbar uses gnuwin32's libintl, then if libbar calls
> bindtextdomain() with a non-relocated compile-time pathname it won't
> automatically find its message catalogs, will it?)
> To make the magic work even in this case, I guess bindtextdomain()
> would have to use something hairy (well, just a few lines of inline
> asm should do?) to find out its return address, find out the HMODULE
> that return address belongs to using GetModuleHandleEx() with
> GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, and use that instead of NULL
> in the call to GetModuleFileName().
Now we know how it works. My question is: Can we make a patch for
gettext 0.17 and have it accepted by Bruno Haible?
Imagine how nice it would be if suddenly ALL programs (and libraries)
are relocatable without extra effort...