#include <config.h>
-#include <cerrno>
-#include <unistd.h>
-
#include "support/lyxlib.h"
#include <boost/scoped_array.hpp>
+#include <cerrno>
+
+
+namespace lyx {
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#ifdef _WIN32
+# include <windows.h>
+#endif
+
using boost::scoped_array;
using std::string;
inline
char * l_getcwd(char * buffer, size_t size)
{
-#ifndef __EMX__
- return ::getcwd(buffer, size);
+#ifdef _WIN32
+ GetCurrentDirectory(size, buffer);
+ return buffer;
#else
- return ::_getcwd2(buffer, size);
+ return ::getcwd(buffer, size);
#endif
}
result = tbuf.get();
return result;
}
+
+
+} // namespace lyx