]> git.lyx.org Git - lyx.git/commitdiff
msvc2015: _wgetmainargs is not available ony more
authorPeter Kümmel <kuemmel@lyx.org>
Sat, 2 Apr 2016 08:59:19 +0000 (10:59 +0200)
committerPeter Kümmel <kuemmel@lyx.org>
Sat, 2 Apr 2016 09:00:42 +0000 (11:00 +0200)
src/support/os_win32.cpp

index c50fa05b1a8370983d6f6c58fd5737f1d109e44c..292555d6c744bb55046699832922fce1027ba093 100644 (file)
 #include <stdio.h>
 #endif
 
-
+#if defined(_MSC_VER) && (_MSC_VER >= 1900)
+#else
 extern "C" {
 extern void __wgetmainargs(int * argc, wchar_t *** argv, wchar_t *** envp,
                           int expand_wildcards, int * new_mode);
 }
+#endif
 
 using namespace std;
 
@@ -157,9 +159,13 @@ void init(int argc, char * argv[])
 
 
        // Get the wide program arguments array
+#if defined(_MSC_VER) && (_MSC_VER >= 1900)
+       argv_ = CommandLineToArgvW(GetCommandLineW(), &argc_);
+#else
        wchar_t ** envp = 0;
        int newmode = 0;
        __wgetmainargs(&argc_, &argv_, &envp, -1, &newmode);
+#endif
        LATTEST(argc == argc_);
 
        // If Cygwin is detected, query the cygdrive prefix.