aboutsummaryrefslogtreecommitdiff
path: root/src/port/chklocale.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2024-08-13 22:13:52 +1200
committerThomas Munro <tmunro@postgresql.org>2024-08-13 22:13:52 +1200
commit14c648ff009438830d15de7c8a93c2b29114eb1c (patch)
treee57013d885e4b82b000d342d408c1c8c2e2d3475 /src/port/chklocale.c
parent93660d1c27b1b85e84621326c0e2c89e00c3fc6f (diff)
downloadpostgresql-14c648ff009438830d15de7c8a93c2b29114eb1c.tar.gz
postgresql-14c648ff009438830d15de7c8a93c2b29114eb1c.zip
All POSIX systems have langinfo.h and CODESET.
We don't need configure probes for HAVE_LANGINFO_H (it is implied by !WIN32), and we don't need to consider systems that have it but don't define CODESET (that was for OpenBSD in commit 81cca218, but it has now had it for 19 years). Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Discussion: https://postgr.es/m/CA%2BhUKGJqVe0%2BPv9dvC9dSums_PXxGo9SWcxYAMBguWJUGbWz-A%40mail.gmail.com
Diffstat (limited to 'src/port/chklocale.c')
-rw-r--r--src/port/chklocale.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/port/chklocale.c b/src/port/chklocale.c
index 8cb81c8640e..a0cc52c38df 100644
--- a/src/port/chklocale.c
+++ b/src/port/chklocale.c
@@ -19,7 +19,7 @@
#include "postgres_fe.h"
#endif
-#ifdef HAVE_LANGINFO_H
+#ifndef WIN32
#include <langinfo.h>
#endif
@@ -287,8 +287,6 @@ pg_codepage_to_encoding(UINT cp)
#endif
#endif /* WIN32 */
-#if (defined(HAVE_LANGINFO_H) && defined(CODESET)) || defined(WIN32)
-
/*
* Given a setting for LC_CTYPE, return the Postgres ID of the associated
* encoding, if we can determine it. Return -1 if we can't determine it.
@@ -415,19 +413,3 @@ pg_get_encoding_from_locale(const char *ctype, bool write_message)
free(sys);
return -1;
}
-#else /* (HAVE_LANGINFO_H && CODESET) || WIN32 */
-
-/*
- * stub if no multi-language platform support
- *
- * Note: we could return -1 here, but that would have the effect of
- * forcing users to specify an encoding to initdb on such platforms.
- * It seems better to silently default to SQL_ASCII.
- */
-int
-pg_get_encoding_from_locale(const char *ctype, bool write_message)
-{
- return PG_SQL_ASCII;
-}
-
-#endif /* (HAVE_LANGINFO_H && CODESET) || WIN32 */