]> git.lyx.org Git - lyx.git/blob - src/support/chdir.C
hopefully fix tex2lyx linking.
[lyx.git] / src / support / chdir.C
1 /**
2  * \file chdir.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "support/lyxlib.h"
14
15
16 namespace lyx {
17
18 #ifdef HAVE_UNISTD_H
19 # include <unistd.h>
20 #endif
21
22 #ifdef _WIN32
23 # include <windows.h>
24 #endif
25
26 int lyx::support::chdir(std::string const & name)
27 {
28 #ifdef _WIN32
29         return SetCurrentDirectory(name.c_str()) != 0 ? 0 : -1;
30 #else
31         return ::chdir(name.c_str());
32 #endif
33 }
34
35
36 } // namespace lyx