Skip to content

Commit ff5565f

Browse files
committed
Suppress unused-function warning on non-WIN32 builds.
1 parent 72826fb commit ff5565f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/bin/initdb/initdb.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ static int locale_date_order(const char *locale);
185185
static bool check_locale_name(const char *locale);
186186
static bool check_locale_encoding(const char *locale, int encoding);
187187
static void setlocales(void);
188-
static void strreplace(char *str, char *needle, char *replacement);
189188
static char *localemap(char *locale);
190189
static void usage(const char *progname);
191190

@@ -2252,6 +2251,8 @@ check_locale_encoding(const char *locale, int user_enc)
22522251
return true;
22532252
}
22542253

2254+
#ifdef WIN32
2255+
22552256
/*
22562257
* Replace 'needle' with 'replacement' in 'str' . Note that the replacement
22572258
* is done in-place, so 'replacement' must be shorter than 'needle'.
@@ -2272,6 +2273,8 @@ strreplace(char *str, char *needle, char *replacement)
22722273
}
22732274
}
22742275

2276+
#endif /* WIN32 */
2277+
22752278
/*
22762279
* Windows has a problem with locale names that have a dot or apostrophe in
22772280
* the country name. For example:
@@ -2321,7 +2324,7 @@ localemap(char *locale)
23212324
strreplace(locale, "Chinese_Macau S.A.R..950", "ZHM");
23222325
strreplace(locale, "Chinese (Traditional)_Macao S.A.R..950", "ZHM");
23232326
strreplace(locale, "Chinese_Macao S.A.R..950", "ZHM");
2324-
#endif
2327+
#endif /* WIN32 */
23252328

23262329
return locale;
23272330
}

0 commit comments

Comments
 (0)