Search Postgresql Archives

Re: Building PostgreSQL 9.6devel sources with Microsoft Visual C++ 2015?

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

 



Please look at the new patch. It is filled with black magic, but it looks still more true.
He agreed with the internal API.

--
Yury Zhuravlev
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
diff --git a/src/port/chklocale.c b/src/port/chklocale.c
index a551fdc..6113424 100644
--- a/src/port/chklocale.c
+++ b/src/port/chklocale.c
@@ -203,7 +203,7 @@ win32_langinfo(const char *ctype)
 {
 	char	   *r = NULL;
 
-#if (_MSC_VER >= 1700)
+#if (_MSC_VER >= 1700 && _MSC_VER < 1800)
 	_locale_t	loct = NULL;
 
 	loct = _create_locale(LC_CTYPE, ctype);
@@ -214,7 +214,20 @@ win32_langinfo(const char *ctype)
 			sprintf(r, "CP%u", loct->locinfo->lc_codepage);
 		_free_locale(loct);
 	}
+#elif (_MSC_VER >= 1800)
+	_locale_t	loct = NULL;
+
+	loct = _create_locale(LC_CTYPE, ctype);
+	if (loct != NULL)
+	{
+		__crt_locale_data_public* public_loct = __acrt_get_locale_data_prefix(loct);
+		r = malloc(16);			/* excess */
+		if (r != NULL)
+			sprintf(r, "CP%u", public_loct->_locale_lc_codepage);
+		_free_locale(loct);
+	}
 #else
+
 	char	   *codepage;
 
 	/*
-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux