Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 253504f

Browse files
committed
Fix build of ICU support in Windows
and also any platform that does not have locale_t but enabled ICU. Author: Ashutosh Sharma <[email protected]>
1 parent bf6e4c3 commit 253504f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backend/commands/collationcmds.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,10 @@ get_icu_locale_comment(const char *localename)
411411
Datum
412412
pg_import_system_collations(PG_FUNCTION_ARGS)
413413
{
414-
#if defined(HAVE_LOCALE_T) && !defined(WIN32)
415414
bool if_not_exists = PG_GETARG_BOOL(0);
416415
Oid nspid = PG_GETARG_OID(1);
417416

417+
#if defined(HAVE_LOCALE_T) && !defined(WIN32)
418418
FILE *locale_a_handle;
419419
char localebuf[NAMEDATALEN]; /* we assume ASCII so this is fine */
420420
int count = 0;
@@ -431,6 +431,12 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
431431
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
432432
(errmsg("must be superuser to import system collations"))));
433433

434+
#if !(defined(HAVE_LOCALE_T) && !defined(WIN32)) && !defined(USE_ICU)
435+
/* silence compiler warnings */
436+
(void) if_not_exists;
437+
(void) nspid;
438+
#endif
439+
434440
#if defined(HAVE_LOCALE_T) && !defined(WIN32)
435441
locale_a_handle = OpenPipeStream("locale -a", "r");
436442
if (locale_a_handle == NULL)

0 commit comments

Comments
 (0)