summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2023-07-09 11:55:03 +1200
committerThomas Munro <tmunro@postgresql.org>2023-07-09 11:55:18 +1200
commit8d9a9f034e925568342c7ccfd8d351a3cd20e7f3 (patch)
tree83a10a9ce2044e613c66dc8cd5275840f9629ced /src/include
parente9f15bc9db7564a29460d089c0917590bc13fffc (diff)
All supported systems have locale_t.
locale_t is defined by POSIX.1-2008 and SUSv4, and available on all targeted systems. For Windows, win32_port.h redirects to a partial implementation called _locale_t. We can now remove a lot of compile-time tests for HAVE_LOCALE_T, and associated comments and dead code branches that were needed for older computers. Since configure + MinGW builds didn't detect locale_t but now we assume that all systems have it, further inconsistencies among the 3 Windows build systems were revealed. With this commit, we no longer define HAVE_WCSTOMBS_L and HAVE_MBSTOWCS_L on any Windows build system, but we have logic to deal with that so that replacements are available where appropriate. Reviewed-by: Noah Misch <noah@leadboat.com> Reviewed-by: Tristan Partin <tristan@neon.tech> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Discussion: https://postgr.es/m/CA%2BhUKGLg7_T2GKwZFAkEf0V7vbnur-NfCjZPKZb%3DZfAXSV1ORw%40mail.gmail.com
Diffstat (limited to 'src/include')
-rw-r--r--src/include/pg_config.h.in3
-rw-r--r--src/include/utils/pg_locale.h7
2 files changed, 1 insertions, 9 deletions
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index ca3a49c5526..d03f6e8de82 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -298,9 +298,6 @@
/* Define to 1 if you have the `zstd' library (-lzstd). */
#undef HAVE_LIBZSTD
-/* Define to 1 if the system has the type `locale_t'. */
-#undef HAVE_LOCALE_T
-
/* Define to 1 if `long int' works and is 64 bits. */
#undef HAVE_LONG_INT_64
diff --git a/src/include/utils/pg_locale.h b/src/include/utils/pg_locale.h
index e2a72435427..6447bea8e0a 100644
--- a/src/include/utils/pg_locale.h
+++ b/src/include/utils/pg_locale.h
@@ -67,9 +67,7 @@ extern void cache_locale_time(void);
/*
- * We define our own wrapper around locale_t so we can keep the same
- * function signatures for all builds, while not having to create a
- * fake version of the standard type locale_t in the global namespace.
+ * We use a discriminated union to hold either a locale_t or an ICU collator.
* pg_locale_t is occasionally checked for truth, so make it a pointer.
*/
struct pg_locale_struct
@@ -78,9 +76,7 @@ struct pg_locale_struct
bool deterministic;
union
{
-#ifdef HAVE_LOCALE_T
locale_t lt;
-#endif
#ifdef USE_ICU
struct
{
@@ -88,7 +84,6 @@ struct pg_locale_struct
UCollator *ucol;
} icu;
#endif
- int dummy; /* in case we have neither LOCALE_T nor ICU */
} info;
};