Fix platform_get_locale_temperature_format() in windows.c

This commit is contained in:
n42k 2016-12-08 12:09:21 +00:00 committed by Ted John
parent 1513b88af7
commit bd02f14699
1 changed files with 9 additions and 9 deletions

View File

@ -966,23 +966,23 @@ uint8 platform_get_locale_measurement_format()
uint8 platform_get_locale_temperature_format()
{
// There does not seem to be a function to obtain this, just check the countries
UINT country;
UINT fahrenheit;
// GetLocaleInfo will set fahrenheit to 1 if the locale on this computer
// uses the United States measurement system or 0 otherwise.
if (GetLocaleInfo(LOCALE_USER_DEFAULT,
LOCALE_IMEASURE | LOCALE_RETURN_NUMBER,
(LPSTR)&country,
sizeof(country)) == 0
(LPSTR)&fahrenheit,
sizeof(fahrenheit)) == 0
) {
// Assume celsius by default if function call fails
return TEMPERATURE_FORMAT_C;
}
switch (country) {
case CTRY_UNITED_STATES:
case CTRY_BELIZE:
if(fahrenheit)
return TEMPERATURE_FORMAT_F;
default:
else
return TEMPERATURE_FORMAT_C;
}
}
bool platform_check_steam_overlay_attached()