Index: src/backend/utils/adt/pg_locale.c
===================================================================
--- src/backend/utils/adt/pg_locale.c	(HEAD)
+++ src/backend/utils/adt/pg_locale.c	(working copy)
@@ -92,7 +92,7 @@
 static char lc_numeric_envbuf[LC_ENV_BUFSIZE];
 static char lc_time_envbuf[LC_ENV_BUFSIZE];
 
-#ifdef WIN32
+#if defined(WIN32) && defined(LC_MESSAGES)
 static char *IsoLocaleName(const char *); /* MSVC specific */
 #endif
 
@@ -158,7 +158,7 @@
 #ifdef WIN32
 			result = IsoLocaleName(locale);
 			if (result == NULL)
-				result = locale;
+				result = (char *) locale;
 #endif /* WIN32 */
 			break;
 #endif /* LC_MESSAGES */
@@ -601,7 +601,7 @@
 }
 
 
-#ifdef WIN32
+#if defined(WIN32) && defined(LC_MESSAGES)
 /*
  *	Convert Windows locale name to the ISO formatted one
  *	if possible.
@@ -647,5 +647,5 @@
 	return NULL; /* Not supported on this version of msvc/mingw */
 #endif /* _MSC_VER >= 1400 */
 }
-#endif /* WIN32 */
+#endif /* WIN32 && LC_MESSAGES */
 
Index: src/test/regress/pg_regress.c
===================================================================
--- src/test/regress/pg_regress.c	(HEAD)
+++ src/test/regress/pg_regress.c	(working copy)
@@ -1364,7 +1364,7 @@
 			if (p == pids[i])
 			{
 #ifdef WIN32
-				GetExitCodeProcess(pids[i], &exit_status);
+				GetExitCodeProcess(pids[i], (LPDWORD) &exit_status);
 				CloseHandle(pids[i]);
 #endif
 				pids[i] = INVALID_PID;
