@@ -103,8 +103,8 @@ static const struct locale_map locale_map_result[] = {
103103
104104#define MAX_LOCALE_NAME_LEN 100
105105
106- static char *
107- map_locale (struct locale_map * map ,char * locale )
106+ static const char *
107+ map_locale (const struct locale_map * map ,const char * locale )
108108{
109109static char aliasbuf [MAX_LOCALE_NAME_LEN ];
110110int i ;
@@ -167,7 +167,7 @@ map_locale(struct locale_map *map, char *locale)
167167char *
168168pgwin32_setlocale (int category ,const char * locale )
169169{
170- char * argument ;
170+ const char * argument ;
171171char * result ;
172172
173173if (locale == NULL )
@@ -178,8 +178,12 @@ pgwin32_setlocale(int category, const char *locale)
178178/* Call the real setlocale() function */
179179result = setlocale (category ,argument );
180180
181+ /*
182+ * setlocale() is specified to return a "char *" that the caller is
183+ * forbidden to modify, so casting away the "const" is innocuous.
184+ */
181185if (result )
182- result = map_locale (locale_map_result ,result );
186+ result = ( char * ) map_locale (locale_map_result ,result );
183187
184188return result ;
185189}