diff options
author | Biswapriyo Nath <nathbappai@gmail.com> | 2022-07-01 21:03:36 +0530 |
---|---|---|
committer | Biswapriyo Nath <nathbappai@gmail.com> | 2022-07-01 22:01:42 +0530 |
commit | 22f7ce58048ddc7d758df4cf61c319e915591890 (patch) | |
tree | 7560b8582a6ff2c5c19bff051986e04da372a8c2 | |
parent | 11db75f37b77faa900255cc4835f4ab390e323bc (diff) | |
download | geocode-glib-22f7ce58048ddc7d758df4cf61c319e915591890.tar.gz |
lib: Fix building for Windows platform
This fixes two build errors in Windows platform.
../geocode-glib/geocode-glib.c:30:10: fatal error: langinfo.h: No such file or directory
../geocode-glib/geocode-glib.c:233:63: error: 'LC_MESSAGES' undeclared (first use in this function)
More info about setlocale function here
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale
-rw-r--r-- | geocode-glib/geocode-glib.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/geocode-glib/geocode-glib.c b/geocode-glib/geocode-glib.c index 8687fec..61aeebe 100644 --- a/geocode-glib/geocode-glib.c +++ b/geocode-glib/geocode-glib.c @@ -27,7 +27,9 @@ #include <locale.h> #include <gio/gio.h> #include <libsoup/soup.h> +#ifndef G_OS_WIN32 #include <langinfo.h> +#endif #include <geocode-glib/geocode-glib-private.h> /** @@ -228,7 +230,11 @@ geocode_object_get_lang_for_locale (const char *locale) char * _geocode_object_get_lang (void) { +#ifdef G_OS_WIN32 + return geocode_object_get_lang_for_locale (setlocale (LC_ALL, NULL)); +#else return geocode_object_get_lang_for_locale (setlocale (LC_MESSAGES, NULL)); +#endif } #if defined(__GLIBC__) && !defined(__UCLIBC__) |