summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut2024-10-01 11:16:04 +0000
committerPeter Eisentraut2024-10-01 11:23:45 +0000
commit9c2a6c5a5f4b94a93120009e623ae8bd153e6dbb (patch)
treebe7c4eb3891de87b8c51cb330c87255fc2d221c0 /src
parentee4859123e3d47aef8cfe078f7faee2ebcecb613 (diff)
Simplify checking for xlocale.h
Instead of XXX_IN_XLOCALE_H for several features XXX, let's just include <xlocale.h> if HAVE_XLOCALE_H. The reason for the extra complication was apparently that some old glibc systems also had an <xlocale.h>, and you weren't supposed to include it directly, but it's gone now (as far as I can tell it was harmless to do so anyway). Author: Thomas Munro <thomas.munro@gmail.com> Discussion: https://postgr.es/m/CWZBBRR6YA8D.8EHMDRGLCKCD%40neon.tech
Diffstat (limited to 'src')
-rw-r--r--src/include/c.h3
-rw-r--r--src/include/pg_config.h.in9
-rw-r--r--src/include/utils/pg_locale.h3
-rw-r--r--src/interfaces/ecpg/ecpglib/ecpglib_extern.h3
-rw-r--r--src/port/chklocale.c4
5 files changed, 6 insertions, 16 deletions
diff --git a/src/include/c.h b/src/include/c.h
index dc1841346cd..3297d89ff0e 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -71,6 +71,9 @@
#include <fcntl.h> /* ensure O_BINARY is available */
#endif
#include <locale.h>
+#ifdef HAVE_XLOCALE_H
+#include <xlocale.h>
+#endif
#ifdef ENABLE_NLS
#include <libintl.h>
#endif
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 38006367a40..6c04347d4e7 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -499,6 +499,9 @@
/* Define to 1 if the assembler supports X86_64's POPCNTQ instruction. */
#undef HAVE_X86_64_POPCNTQ
+/* Define to 1 if you have the <xlocale.h> header file. */
+#undef HAVE_XLOCALE_H
+
/* Define to 1 if you have XSAVE intrinsics. */
#undef HAVE_XSAVE_INTRINSICS
@@ -559,9 +562,6 @@
/* Define to the appropriate printf length modifier for 64-bit ints. */
#undef INT64_MODIFIER
-/* Define to 1 if `locale_t' requires <xlocale.h>. */
-#undef LOCALE_T_IN_XLOCALE
-
/* Define as the maximum alignment requirement of any C data type. */
#undef MAXIMUM_ALIGNOF
@@ -748,9 +748,6 @@
/* Define to 1 to build with ZSTD support. (--with-zstd) */
#undef USE_ZSTD
-/* Define to 1 if `wcstombs_l' requires <xlocale.h>. */
-#undef WCSTOMBS_L_IN_XLOCALE
-
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
diff --git a/src/include/utils/pg_locale.h b/src/include/utils/pg_locale.h
index 3b443df8014..37ecf951937 100644
--- a/src/include/utils/pg_locale.h
+++ b/src/include/utils/pg_locale.h
@@ -12,9 +12,6 @@
#ifndef _PG_LOCALE_
#define _PG_LOCALE_
-#if defined(LOCALE_T_IN_XLOCALE) || defined(WCSTOMBS_L_IN_XLOCALE)
-#include <xlocale.h>
-#endif
#ifdef USE_ICU
#include <unicode/ucol.h>
#endif
diff --git a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
index 01b4309a710..bad3cd9920b 100644
--- a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
+++ b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
@@ -13,9 +13,6 @@
#ifndef CHAR_BIT
#include <limits.h>
#endif
-#ifdef LOCALE_T_IN_XLOCALE
-#include <xlocale.h>
-#endif
enum COMPAT_MODE
{
diff --git a/src/port/chklocale.c b/src/port/chklocale.c
index 9506cd87ed8..afdbd9c875b 100644
--- a/src/port/chklocale.c
+++ b/src/port/chklocale.c
@@ -23,10 +23,6 @@
#include <langinfo.h>
#endif
-#ifdef LOCALE_T_IN_XLOCALE
-#include <xlocale.h>
-#endif
-
#include "mb/pg_wchar.h"