]> granicus.if.org Git - postgresql/commitdiff
Avoid unreferenced-function warning on low-functionality platforms.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 8 Jul 2017 16:42:25 +0000 (12:42 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 8 Jul 2017 16:42:25 +0000 (12:42 -0400)
On platforms lacking both locale_t and ICU, collationcmds.c failed
to make any use of its static function is_all_ascii(), thus probably
drawing a compiler warning.  Oversight in my commit ddb5fdc06.
Per buildfarm member gaur.

src/backend/commands/collationcmds.c

index 418f7342c77fccb4c7bb5783cdf1f6f5b343b35d..b6c14c920df04054b0e6a56ef13bff25dc171b21 100644 (file)
@@ -357,6 +357,12 @@ pg_collation_actual_version(PG_FUNCTION_ARGS)
 }
 
 
+/* will we use "locale -a" in pg_import_system_collations? */
+#if defined(HAVE_LOCALE_T) && !defined(WIN32)
+#define READ_LOCALE_A_OUTPUT
+#endif
+
+#if defined(READ_LOCALE_A_OUTPUT) || defined(USE_ICU)
 /*
  * Check a string to see if it is pure ASCII
  */
@@ -371,11 +377,7 @@ is_all_ascii(const char *str)
        }
        return true;
 }
-
-/* will we use "locale -a" in pg_import_system_collations? */
-#if defined(HAVE_LOCALE_T) && !defined(WIN32)
-#define READ_LOCALE_A_OUTPUT
-#endif
+#endif                                                 /* READ_LOCALE_A_OUTPUT || USE_ICU */
 
 #ifdef READ_LOCALE_A_OUTPUT
 /*