]> git.lyx.org Git - lyx.git/blob - src/support/chdir.C
MacOSX compile fix.
[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 #ifdef HAVE_UNISTD_H
16 # include <unistd.h>
17 #endif
18
19 #ifdef _WIN32
20 # include <windows.h>
21 #endif
22
23 int lyx::support::chdir(std::string const & name)
24 {
25 #ifdef _WIN32
26         return SetCurrentDirectory(name.c_str()) != 0 ? 0 : -1;
27 #else
28         return ::chdir(name.c_str());
29 #endif
30 }