- os::init(&argc, &argv);
- int const val = GUIRunTime::initApplication(argc, argv);
- if (val)
- return val;
-
- // lyx_localedir is used by gettext_init() is we have
- // i18n support built-in
- string lyx_localedir = GetEnvPath("LYX_LOCALEDIR");
- if (lyx_localedir.empty())
- lyx_localedir = LOCALEDIR;
-
+#ifdef HAVE_IOS
+ std::ios_base::sync_with_stdio(false);
+#endif
+ fs::path::default_name_check(fs::no_check);
+
+ // To avoid ordering of global object problems with some
+ // stdlibs we do the initialization here, but still as
+ // early as possible.
+ lyx::lyxerr.rdbuf(std::cerr.rdbuf());
+
+ lyx::support::os::init(argc, argv);
+