| 340 | } |
| 341 | |
| 342 | TemperatureUnit GetLocaleTemperatureFormat() |
| 343 | { |
| 344 | // LC_MEASUREMENT is GNU specific. |
| 345 | #ifdef LC_MEASUREMENT |
| 346 | const char* langstring = setlocale(LC_MEASUREMENT, ""); |
| 347 | #else |
| 348 | const char* langstring = setlocale(LC_ALL, ""); |
| 349 | #endif |
| 350 | |
| 351 | if (langstring != nullptr) |
| 352 | { |
| 353 | if (!fnmatch("*_US*", langstring, 0) || !fnmatch("*_BS*", langstring, 0) || !fnmatch("*_BZ*", langstring, 0) |
| 354 | || !fnmatch("*_PW*", langstring, 0)) |
| 355 | { |
| 356 | return TemperatureUnit::fahrenheit; |
| 357 | } |
| 358 | } |
| 359 | return TemperatureUnit::celsius; |
| 360 | } |
| 361 | |
| 362 | bool ProcessIsElevated() |
| 363 | { |