summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/mb/pg_wchar.h7
-rw-r--r--src/include/pg_config.h.in3
-rw-r--r--src/include/pg_config.h.win323
-rw-r--r--src/include/port/win32.h2
-rw-r--r--src/include/utils/pg_locale.h8
5 files changed, 16 insertions, 7 deletions
diff --git a/src/include/mb/pg_wchar.h b/src/include/mb/pg_wchar.h
index 8efc6d3046..826c7af53b 100644
--- a/src/include/mb/pg_wchar.h
+++ b/src/include/mb/pg_wchar.h
@@ -19,8 +19,6 @@
#ifndef PG_WCHAR_H
#define PG_WCHAR_H
-#include <sys/types.h>
-
/*
* The pg_wchar type
*/
@@ -392,11 +390,6 @@ extern int pg_mbcharcliplen(const char *mbstr, int len, int imit);
extern int pg_encoding_max_length(int encoding);
extern int pg_database_encoding_max_length(void);
-#ifdef USE_WIDE_UPPER_LOWER
-extern size_t wchar2char(char *to, const wchar_t *from, size_t tolen, Oid collation);
-extern size_t char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen, Oid collation);
-#endif
-
extern int PrepareClientEncoding(int encoding);
extern int SetClientEncoding(int encoding);
extern void InitializeClientEncoding(void);
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 3ee1d077a5..04560c74bf 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -656,6 +656,9 @@
/* Define to 1 if you have the `wcstombs' function. */
#undef HAVE_WCSTOMBS
+/* Define to 1 if you have the `wcstombs_l' function. */
+#undef HAVE_WCSTOMBS_L
+
/* Define to 1 if you have the <wctype.h> header file. */
#undef HAVE_WCTYPE_H
diff --git a/src/include/pg_config.h.win32 b/src/include/pg_config.h.win32
index 177bca1bd5..b85bf411de 100644
--- a/src/include/pg_config.h.win32
+++ b/src/include/pg_config.h.win32
@@ -538,6 +538,9 @@
/* Define to 1 if you have the `wcstombs' function. */
#define HAVE_WCSTOMBS 1
+/* Define to 1 if you have the `wcstombs_l' function. */
+#define HAVE_WCSTOMBS_L 1
+
/* Define to 1 if you have the <wctype.h> header file. */
#define HAVE_WCTYPE_H 1
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 8a3c33f995..2914a59811 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -304,6 +304,8 @@ typedef int pid_t;
#define iswspace_l _iswspace_l
#define strcoll_l _strcoll_l
#define wcscoll_l _wcscoll_l
+#define wcstombs_l _wcstombs_l
+#define mbstowcs_l _mbstowcs_l
/* In backend/port/win32/signal.c */
diff --git a/src/include/utils/pg_locale.h b/src/include/utils/pg_locale.h
index 25b9d50915..c59a004fc9 100644
--- a/src/include/utils/pg_locale.h
+++ b/src/include/utils/pg_locale.h
@@ -72,4 +72,12 @@ typedef int pg_locale_t;
extern pg_locale_t pg_newlocale_from_collation(Oid collid);
+/* These functions convert from/to libc's wchar_t, *not* pg_wchar_t */
+#ifdef USE_WIDE_UPPER_LOWER
+extern size_t wchar2char(char *to, const wchar_t *from, size_t tolen,
+ pg_locale_t locale);
+extern size_t char2wchar(wchar_t *to, size_t tolen,
+ const char *from, size_t fromlen, pg_locale_t locale);
+#endif
+
#endif /* _PG_LOCALE_ */