From d48f7ccb5a7fd8bab3ff938f66eb6254d07a8926 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Sat, 23 Jul 2022 15:23:09 +1200
Subject: [PATCH 2/2] Remove <wchar.h> needed by some pre-C99 systems.

According to the comments removed by this commit, unnamed pre-C99
systems required <wchar.h>, where <wctype.h> should be enough now.  If
this was a reference to decommissioned build farm animal gaur, we should
now be able able to remove that code.
---
 src/backend/utils/adt/formatting.c | 6 ------
 src/include/regex/regcustom.h      | 6 ------
 src/include/tsearch/ts_locale.h    | 8 +-------
 3 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index 5ba1ff4666..6f8734a947 100644
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -69,12 +69,6 @@
 #include <math.h>
 #include <float.h>
 #include <limits.h>
-
-/*
- * towlower() and friends should be in <wctype.h>, but some pre-C99 systems
- * declare them in <wchar.h>, so include that too.
- */
-#include <wchar.h>
 #include <wctype.h>
 
 #ifdef USE_ICU
diff --git a/src/include/regex/regcustom.h b/src/include/regex/regcustom.h
index 4e215267f8..fc158e1bb7 100644
--- a/src/include/regex/regcustom.h
+++ b/src/include/regex/regcustom.h
@@ -40,12 +40,6 @@
 
 #include <ctype.h>
 #include <limits.h>
-
-/*
- * towlower() and friends should be in <wctype.h>, but some pre-C99 systems
- * declare them in <wchar.h>, so include that too.
- */
-#include <wchar.h>
 #include <wctype.h>
 
 #include "mb/pg_wchar.h"
diff --git a/src/include/tsearch/ts_locale.h b/src/include/tsearch/ts_locale.h
index 949258760d..d14cb4ed26 100644
--- a/src/include/tsearch/ts_locale.h
+++ b/src/include/tsearch/ts_locale.h
@@ -14,18 +14,12 @@
 
 #include <ctype.h>
 #include <limits.h>
+#include <wctype.h>
 
 #include "lib/stringinfo.h"
 #include "mb/pg_wchar.h"
 #include "utils/pg_locale.h"
 
-/*
- * towlower() and friends should be in <wctype.h>, but some pre-C99 systems
- * declare them in <wchar.h>, so include that too.
- */
-#include <wchar.h>
-#include <wctype.h>
-
 /* working state for tsearch_readline (should be a local var in caller) */
 typedef struct
 {
-- 
2.36.1

