@@ -1554,7 +1554,9 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
15541554#endif /* USE_WIDE_UPPER_LOWER */
15551555 else
15561556 {
1557+ #ifdef HAVE_LOCALE_T
15571558 pg_locale_t mylocale = 0 ;
1559+ #endif
15581560 char * p ;
15591561
15601562 if (collid != DEFAULT_COLLATION_OID )
@@ -1570,7 +1572,9 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
15701572 errmsg ("could not determine which collation to use for lower() function" ),
15711573 errhint ("Use the COLLATE clause to set the collation explicitly." )));
15721574 }
1575+ #ifdef HAVE_LOCALE_T
15731576 mylocale = pg_newlocale_from_collation (collid );
1577+ #endif
15741578 }
15751579
15761580 result = pnstrdup (buff , nbytes );
@@ -1675,7 +1679,9 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
16751679#endif /* USE_WIDE_UPPER_LOWER */
16761680 else
16771681 {
1682+ #ifdef HAVE_LOCALE_T
16781683 pg_locale_t mylocale = 0 ;
1684+ #endif
16791685 char * p ;
16801686
16811687 if (collid != DEFAULT_COLLATION_OID )
@@ -1691,7 +1697,9 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
16911697 errmsg ("could not determine which collation to use for upper() function" ),
16921698 errhint ("Use the COLLATE clause to set the collation explicitly." )));
16931699 }
1700+ #ifdef HAVE_LOCALE_T
16941701 mylocale = pg_newlocale_from_collation (collid );
1702+ #endif
16951703 }
16961704
16971705 result = pnstrdup (buff , nbytes );
@@ -1820,7 +1828,9 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
18201828#endif /* USE_WIDE_UPPER_LOWER */
18211829 else
18221830 {
1831+ #ifdef HAVE_LOCALE_T
18231832 pg_locale_t mylocale = 0 ;
1833+ #endif
18241834 char * p ;
18251835
18261836 if (collid != DEFAULT_COLLATION_OID )
@@ -1836,7 +1846,9 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
18361846 errmsg ("could not determine which collation to use for initcap() function" ),
18371847 errhint ("Use the COLLATE clause to set the collation explicitly." )));
18381848 }
1849+ #ifdef HAVE_LOCALE_T
18391850 mylocale = pg_newlocale_from_collation (collid );
1851+ #endif
18401852 }
18411853
18421854 result = pnstrdup (buff , nbytes );
0 commit comments