Instead of only getting it on Linux. Also use nl_langinfo()
when available, and not only on Linux.
https://bugzilla.gnome.org/show_bug.cgi?id=604858
dnl ******************************
dnl Checks for functions
dnl ******************************
-AC_CHECK_FUNCS(fsync strptime strtok_r)
+AC_CHECK_FUNCS(fsync strptime strtok_r nl_langinfo)
dnl ***********************************
dnl Check for base dependencies early.
*/
#include <config.h>
-
-#ifdef __linux__
-/* We need this to get a prototype for strptime. */
-#define _GNU_SOURCE
-#endif /* __linux__ */
+#define _XOPEN_SOURCE
#include <time.h>
#include <sys/time.h>
-#ifdef __linux__
+#ifdef HAVE_NL_LANGINFO
#include <langinfo.h>
-#undef _GNU_SOURCE
-#endif /* __linux__ */
+#endif /* HAVE_NL_LANGINFO */
#include <string.h>
#include <ctype.h>
{
gchar *p;
gchar *res = NULL;
-#if defined(__linux__)
+#if defined(HAVE_NL_LANGINFO)
res = g_strdup (nl_langinfo (D_FMT) );
#elif defined(G_OS_WIN32)
#define GET_LOCALE_INFO(str, len) GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SLONGDATE, str, len)