Re: Visual Studio 2012 RC

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: Visual Studio 2012 RC
Дата
Msg-id 20130101025421.GA17763@tornado.leadboat.com
обсуждение исходный текст
Ответ на Re: Visual Studio 2012 RC  (Noah Misch <noah@leadboat.com>)
Ответы Re: Visual Studio 2012 RC  (Craig Ringer <craig@2ndQuadrant.com>)
Список pgsql-hackers
On Mon, Oct 15, 2012 at 07:53:51AM -0400, Noah Misch wrote:
> The only matter still requiring attention is a fix for IsoLocaleName().

Following off-list coordination with Brar, I went about finishing up this
patch.  The above problem proved deeper than expected.  For Windows Vista,
Microsoft made RFC 4646 tags the preferred way to denote a locale in Windows.
Microsoft calls them "locale names".  Starting with Visual Studio 2012,
setlocale() accepts locale names in addition to all the things it previously
accepted.  One can now use things like "initdb --locale=zh-CN" and "CREATE
DATABASE foo LC_CTYPE = 'pl'".  This meant updating win32_langinfo() and
find_matching_ts_config() to handle the new formats.  In passing, I fixed an
unchecked malloc() in win32_langinfo().

In addition to expanding the set of valid locale inputs, VS2012 changes the
(undocumented) content of _locale_t to hold locale names where it previously
held locale identifiers.  I taught IsoLocaleName() to handle the new material.
I also sought to improve the comments on IsoLocaleName(); its significance was
not previously clear to me.  This thread has some background:
http://archives.postgresql.org/message-id/4964B45E.5080003@hagander.net

Though I'm not entirely sanguine about digging into the officially-opaque
_locale_t, we have been doing it that way for several years.  None of the
alternatives are clearly-satisfying.  In particular, I found no good way to
look up the code page corresponding to a locale name on pre-Vista systems.
The CRT itself handles this by translating locale names to locale identifiers
using a lookup table.  The Gnulib "localename" and "setlocale" modules are
also interesting studies on the topic.

In previous reviews, I missed the need to update pgwin32_putenv().  The
addition of VS2010 support had also missed it, so this catches up.  That
function has other problems, but I will hold them for another patch.

Tester warning: if you currently have some form of VS2010 installed, including
the compilers of Windows SDK 7.1, beware of this problem:

http://stackoverflow.com/questions/10888391/link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-invalid-or-c

Thanks,
nm

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: dynamic SQL - possible performance regression in 9.2
Следующее
От: Magnus Hagander
Дата:
Сообщение: pg_retainxlog for inclusion in 9.3?