]> git.lyx.org Git - lyx.git/blobdiff - src/support/os_cygwin.cpp
TR1: check in cmake for GCC version, fallback in checktr1.h for other build systems...
[lyx.git] / src / support / os_cygwin.cpp
index 4a38a6d105c434a28ae1b842a0bf8c8b84462155..31416c0f711190a8cc18c50d91a2b478035aee95 100644 (file)
@@ -18,6 +18,7 @@
 #include "support/os.h"
 
 #include "support/FileName.h"
+#include "support/lassert.h"
 #include "support/lstrings.h"
 #include "support/debug.h"
 
@@ -45,6 +46,9 @@ namespace os {
 
 namespace {
 
+int argc_ = 0;
+char ** argv_ = 0;
+
 bool windows_style_tex_paths_ = false;
 
 // In both is_posix_path() and is_windows_path() it is assumed that
@@ -202,8 +206,11 @@ BOOL terminate_handler(DWORD event)
 
 } // namespace anon
 
-void init(int, char *[])
+void init(int argc, char * argv[])
 {
+       argc_ = argc;
+       argv_ = argv;
+
        // Make sure that the TEMP variable is set
        // and sync the Windows environment.
        setenv("TEMP", "/tmp", false);
@@ -214,6 +221,17 @@ void init(int, char *[])
 }
 
 
+string utf8_argv(int i)
+{
+       LASSERT(i < argc_, /**/);
+       return to_utf8(from_local8bit(argv_[i]));
+}
+
+
+void remove_internal_args(int, int)
+{}
+
+
 string current_root()
 {
        return string("/");
@@ -411,7 +429,7 @@ string real_path(string const & path)
 {
        char rpath[PATH_MAX + 1];
        char * result = realpath(path.c_str(), rpath);
-       return FileName::fromFilesystemEncoding(result ? rpath : path).absFilename();
+       return FileName::fromFilesystemEncoding(result ? rpath : path).absFileName();
 }
 
 } // namespace os