Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't find glib_get_locale_dir() #5

Closed
jcupitt opened this issue May 11, 2017 · 4 comments
Closed

can't find glib_get_locale_dir() #5

jcupitt opened this issue May 11, 2017 · 4 comments

Comments

@jcupitt
Copy link

jcupitt commented May 11, 2017

Hi!

I'm trying to fold your great vips patches into libvips master, but I'm being dumb, I can't find the source for glib_get_locale_dir(). Could you point me towards it?

I have this so far:

jcupitt/libvips@ba129fc

@tumagonx
Copy link
Owner

ahh my bad habit, ever since glib drop the use of .def files that private _glib_get_locale_dir() get exported in dll, and since I'm too lazy wrote proper dllmain()->g_win32_get_package_installation_directory_of_module() stuff I always call that convenient function
it should be like:

#ifdef G_OS_WIN32
#include <windows.h>
HMODULE vips_dll = NULL;
#ifdef DLL_EXPORT
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
	 DWORD     fdwReason,
	 LPVOID    lpvReserved)
{
  if (fdwReason == DLL_PROCESS_ATTACH)
      vips_dll = hinstDLL;

  return TRUE;
}
#endif
#endif
...
#ifdef _WIN32
	localedir = g_build_filename(g_win32_get_package_installation_directory_of_module(vips_dll),"share","locale",NULL));
	bindtextdomain (GETTEXT_PACKAGE, localedir);
	g_free (localedir);
#else
 	bindtextdomain( GETTEXT_PACKAGE, name );
#endif

@jcupitt
Copy link
Author

jcupitt commented May 11, 2017

That's great! Thanks, copypasted in.

@jcupitt jcupitt closed this as completed May 11, 2017
@jcupitt
Copy link
Author

jcupitt commented May 11, 2017

(I've not been able to actually test on win, but hopefully it'll work)

jcupitt added a commit to libvips/libvips that referenced this issue May 13, 2017
@jcupitt
Copy link
Author

jcupitt commented May 13, 2017

I improved it a bit. Thank you again for fixing this dumbness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants