locale always requires libc

This commit is contained in:
Mitchell Hashimoto
2022-11-14 10:02:48 -08:00
parent ad203db6e4
commit 20cbee5370

View File

@ -7,12 +7,13 @@ const log = std.log.scoped(.os);
/// Ensure that the locale is set. /// Ensure that the locale is set.
pub fn ensureLocale() void { pub fn ensureLocale() void {
assert(builtin.link_libc);
// On macOS, pre-populate the LANG env var with system preferences. // On macOS, pre-populate the LANG env var with system preferences.
// When launching the .app, LANG is not set so we must query it from the // When launching the .app, LANG is not set so we must query it from the
// OS. When launching from the CLI, LANG is usually set by the parent // OS. When launching from the CLI, LANG is usually set by the parent
// process. // process.
if (comptime builtin.target.isDarwin()) { if (comptime builtin.target.isDarwin()) {
assert(builtin.link_libc);
if (std.os.getenv("LANG") == null) { if (std.os.getenv("LANG") == null) {
setLangFromCocoa(); setLangFromCocoa();
} }