diff options
author | Thomas Munro <tmunro@postgresql.org> | 2024-11-27 22:34:11 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2024-11-27 23:13:45 +1300 |
commit | 1758d42446161f5dfae9b14791c5640239b86faa (patch) | |
tree | af974a289cd49f4bea8fcc97aae4a3a31581a251 /src | |
parent | f1da075d9a0373c08af32e31dcbf0809ae4aec2f (diff) | |
download | postgresql-1758d42446161f5dfae9b14791c5640239b86faa.tar.gz postgresql-1758d42446161f5dfae9b14791c5640239b86faa.zip |
Require ucrt if using MinGW.
Historically we tolerated the absence of various C runtime library
features for the benefit of the MinGW tool chain, because it used
ancient msvcrt.dll for a long period of time. It now uses ucrt by
default (like Windows 10+, Visual Studio 2015+), and that's the only
configuration we're testing.
In practice, we effectively required ucrt already in PostgreSQL 17, when
commit 8d9a9f03 required _create_locale etc, first available in
msvcr120.dll (Visual Studio 2013, the last of the pre-ucrt series of
runtimes), and for MinGW users that practically meant ucrt because it
was difficult or impossible to use msvcr120.dll. That may even not have
been the first such case, but old MinGW configurations had already
dropped off our testing radar so we weren't paying much attention.
This commit formalizes the requirement. It also removes a couple of
obsolete comments that discussed msvcrt.dll limitations, and some tests
of !defined(_MSC_VER) to imply msvcrt.dll. There are many more
anachronisms, but it'll take some time to figure out how to remove them
all. APIs affected relate to locales, UTF-8, threads, large files and
more.
Thanks to Peter Eisentraut for the documentation change. It's not
really necessary to talk about ucrt explicitly in such a short section,
since it's the default for MinGW-w64 and MSYS2. It's enough to prune
references and broken links to much older tools.
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/d9e7731c-ca1b-477c-9298-fa51e135574a%40eisentraut.org
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/utils/adt/pg_locale.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index 06cc42c1f04..9412cad3ac5 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -1017,13 +1017,6 @@ cache_locale_time(void) * get ISO Locale name directly by using GetLocaleInfoEx() with LCType as * LOCALE_SNAME. * - * MinGW headers declare _create_locale(), but msvcrt.dll lacks that symbol in - * releases before Windows 8. IsoLocaleName() always fails in a MinGW-built - * postgres.exe, so only Unix-style values of the lc_messages GUC can elicit - * localized messages. In particular, every lc_messages setting that initdb - * can select automatically will yield only C-locale messages. XXX This could - * be fixed by running the fully-qualified locale name through a lookup table. - * * This function returns a pointer to a static buffer bearing the converted * name or NULL if conversion fails. * @@ -1031,8 +1024,6 @@ cache_locale_time(void) * [2] https://docs.microsoft.com/en-us/windows/win32/intl/locale-names */ -#if defined(_MSC_VER) - /* * Callback function for EnumSystemLocalesEx() in get_iso_localename(). * @@ -1201,16 +1192,6 @@ IsoLocaleName(const char *winlocname) return get_iso_localename(winlocname); } -#else /* !defined(_MSC_VER) */ - -static char * -IsoLocaleName(const char *winlocname) -{ - return NULL; /* Not supported on MinGW */ -} - -#endif /* defined(_MSC_VER) */ - #endif /* WIN32 && LC_MESSAGES */ |