Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Translate en_US.* into C

It seems this is necessary to run clang for linux without locale info.
  • Loading branch information...
commit 75d921fc45042673b2953acd1b8a85e97961f833 1 parent a0ace63
Shinichiro Hamaji authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 libmac/mac.c
View
7 libmac/mac.c
@@ -1291,6 +1291,13 @@ locale_t __darwin_newlocale(int category_mask, const char* locale,
// We'll use current locale (NULL) instead of the global locale.
if (base == LC_GLOBAL_LOCALE)
base = NULL;
+ // It seems the following 5 locales are the same as "C" for Mac.
+ if (!strcmp(locale, "en_US") ||
+ !strcmp(locale, "en_US.ISO8859-1") ||
+ !strcmp(locale, "en_US.ISO8859-15") ||
+ !strcmp(locale, "en_US.US-ASCII") ||
+ !strcmp(locale, "en_US.UTF-8"))
+ locale = "C";
return newlocale(linux_category_mask, locale, base);
}
Please sign in to comment.
Something went wrong with that request. Please try again.